2 Improved answer by specifying intellectual contribution
source | link

If you wrote the code as part of your work as a PhD candidate, and were at all considered an employee of the institution as a PhD candidate, then the institution may well own intellectual property rights to the code you write ("work for hire" rules). This of course depends on the laws of the country where your institution resides.

If you wrote code that is essential for some future work of your supervisor, and which reflects an important intellectual contribution, then either (a) it should be cited if a publication describing the code exists; or (b) you should be an author on publications using the code.

In any case you have a moral (and possibly legal) responsibility to share the code; your supervisor has a reciprocal responsibility to acknowledge your contribution properly. Ideally you should publish your method (e.g. Frontiers Neuroinformatics), and then it can be cited in academic work.

If you wrote the code as part of your work as a PhD candidate, and were at all considered an employee of the institution as a PhD candidate, then the institution may well own intellectual property rights to the code you write ("work for hire" rules). This of course depends on the laws of the country where your institution resides.

If you wrote code that is essential for some future work of your supervisor, then either (a) it should be cited if a publication describing the code exists; or (b) you should be an author on publications using the code.

In any case you have a moral (and possibly legal) responsibility to share the code; your supervisor has a reciprocal responsibility to acknowledge your contribution properly. Ideally you should publish your method (e.g. Frontiers Neuroinformatics), and then it can be cited in academic work.

If you wrote the code as part of your work as a PhD candidate, and were at all considered an employee of the institution as a PhD candidate, then the institution may well own intellectual property rights to the code you write ("work for hire" rules). This of course depends on the laws of the country where your institution resides.

If you wrote code that is essential for some future work of your supervisor, and which reflects an important intellectual contribution, then either (a) it should be cited if a publication describing the code exists; or (b) you should be an author on publications using the code.

In any case you have a moral (and possibly legal) responsibility to share the code; your supervisor has a reciprocal responsibility to acknowledge your contribution properly. Ideally you should publish your method (e.g. Frontiers Neuroinformatics), and then it can be cited in academic work.

1
source | link

If you wrote the code as part of your work as a PhD candidate, and were at all considered an employee of the institution as a PhD candidate, then the institution may well own intellectual property rights to the code you write ("work for hire" rules). This of course depends on the laws of the country where your institution resides.

If you wrote code that is essential for some future work of your supervisor, then either (a) it should be cited if a publication describing the code exists; or (b) you should be an author on publications using the code.

In any case you have a moral (and possibly legal) responsibility to share the code; your supervisor has a reciprocal responsibility to acknowledge your contribution properly. Ideally you should publish your method (e.g. Frontiers Neuroinformatics), and then it can be cited in academic work.