frankyeh / DSI-Studio

A Tractography Tool for Diffusion MRI
http://dsi-studio.labsolver.org
Other
118 stars 54 forks source link

Implement /out, /work, /atlases as mounting points for docker container #56

Closed JohannesWiesner closed 2 years ago

JohannesWiesner commented 3 years ago

Right now the dsi studio docker image offers a /data folder which one can use do mount the local directory where the data is stored inside the container. However, if would be nice, if the container would also offer an /out directory (to mount a local output directory) a /work directory (to mount a local directory that contains script files) and maybe also an /atlases directory to mount a local directory that contains custom atlases. Of course the names are arbitrary here, they could also be named /output, /workdir, /user_atlases or something like that. Perhaps it would make sense to stick to fmripreps convention of how to name these folders.

frankyeh commented 3 years ago

If you have any idea how to accomplish this in the docker container, I would appreciate your instructions to make these possible. (I am still learning how to use the docker container).

Currently, DSI Studio command-line interface support --output to specify output files to a directory. Frank

On Tue, Jun 1, 2021 at 11:50 AM JohannesWiesner @.***> wrote:

Right now the dsi studio docker image offers a /data folder which one can use do mount the local directory where the data is stored inside the container. However, if would be nice, if the container would also offer an /out directory (to mount a local output directory) a /work directory (to mount a local directory that contains script files) and maybe also an /atlases directory to mount a local directory that contains custom atlases. Of course the names are arbitrary here, they could also be named /output, workdir or something like that. Perhaps it would make sense to stick to fmripreps https://fmriprep.org/en/stable/index.htmlconvention of how to name these folders.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/frankyeh/DSI-Studio/issues/56, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACDI4NMQXLFIJQR363ZQ7DTQT6VPANCNFSM4546Q5WA .

JohannesWiesner commented 3 years ago

Hi Frank, I also don't have that much experience with writing Dockerfiles but I guess this should be feasible with the following lines of code that would need to be added to your Dockerfile

USER root

RUN mkdir /output && chmod 777 /output && chmod a+s /output

RUN mkdir /workdir && chmod 777 /workdir && chmod a+s /workdir

RUN mkdir /atlases && chmod 777 /workdir && chmod a+s /atlases

But take this with a big grain of salt, I could be wrong here and it would definitely make sense if someone with more experience in writing Dockerfiles would have a look on it. I am a little bit confused though: Didn't you write the code that creates the /data directory in the docker image? If yes, then I guess you just can repeat those lines of codes for /output,/workdir and /atlases?

I couldn't find any code for that in your Dockerfile though....

frankyeh commented 3 years ago

Thanks for the information. It seems to me that DSI Studio should not output processed files in the docker folders.

The current --output parameter will support writing files to any destination.

But take this with a big grain of salt, I could be wrong here and it would definitely make sense if someone with more experience in writing Dockerfiles would have a look on it. I am a little bit confused though: Didn't you write the code that creates the /data directory in the docker image? If yes, then I guess you just can repeat those lines of codes for /output,/workdir and /atlases?

There is no code that creates the /data folder. All other folders are created after unzipping the atlas and template files.

I couldn't find any code for that in your Dockerfile https://hub.docker.com/layers/dsistudio/dsistudio/latest/images/sha256-c4bb1e8667b521c60e82187a7de39b83b439206057818f388960a7847582c066?context=explore though....

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/frankyeh/DSI-Studio/issues/56#issuecomment-859505019, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACDI4OTNSJ3D5GRERBJVDDTSHVGVANCNFSM4546Q5WA .

JohannesWiesner commented 3 years ago

Hi Frank, of course, any local directory that you mount to the docker container can serve as an output directory for DSI-Studios --output keyword. In my case, it would make sense to have \workdir, output, and \atlas available as mounting points because I store the respective local folders in different locations.

There is no code that creates the /data folder. All other folders are created after unzipping the atlas and template files.

That's strange, but somehow it must have been created at some point? Feel free to share your Dockerfile with me (johannes.wiesner@zi-mannheim.de), then I could try to have a look what is going on and try to add those other folders.

frankyeh commented 3 years ago

The docker file can be found here https://github.com/frankyeh/DSI-Studio/blob/master/Dockerfile

On Wed, Jun 30, 2021 at 8:12 AM JohannesWiesner @.***> wrote:

Hi Frank, of course, any local directory that you mount to the docker container can serve as an output directory for DSI-Studios --output keyword. In my case, it would make sense to have \workdir, output, and \atlas available as mounting points because I store the respective local folders in different locations.

There is no code that creates the /data folder. All other folders are created after unzipping the atlas and template files.

That's strange, but somehow it must have been created at some point? Feel free to share your Dockerfile with me @.***), then I could try to have a look what is going on and try to add those other folders.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/frankyeh/DSI-Studio/issues/56#issuecomment-871349617, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACDI4JREU4M3G7DDPF5QMTTVMC2NANCNFSM4546Q5WA .

frankyeh commented 2 years ago

It seems that the docker can directly mount directories to /out /work /atlases using the -v command. There is no need to create them first.