Hello everyone,
Here’s my setup:
XNAT: 1.8.10
Container Service: 3.5.0
OHIF Viewer: 3.7.1
OS: Linux
Installation: via Docker using NRG XNAT Docker Compose
I’m trying to understand how to properly manage input and output within a custom container developed for use with the XNAT Container Service.
My goal is to build something similar to dcm2niix: a container that takes a folder containing DICOM files as input, performs some processing (for example, modifying a parameter), and then saves the resulting DICOM files as output.
I’m starting with a simplified version, just to understand the workflow before implementing the final functionality.
I’ve attached the files I’m using for these initial tests.
These are the commands I use to build and test the container outside of XNAT:
I’d like to know the correct way to make XNAT mount and handle the input/output folders within the container, and whether there are specific best practices to follow when defining the command.json.
--
You received this message because you are subscribed to the Google Groups "xnat_discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xnat_discussi...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/xnat_discussion/c2758583-a8e8-40c6-96a9-0a2074859413n%40googlegroups.com.
Hi John,
thank you for your valuable advice — it really helped!
I’ve managed to read the files inside the DICOM folder and create an output folder called NEW-DICOM, but this folder doesn’t get populated with the expected files (whereas when I run the same container outside of XNAT, the files are generated correctly).
Below you can find my code and the Container Execution Log.
I’ve compared it with the dcm2niix example (which I used as a reference), and they look quite similar to me.
Dockerfile
command.json
xnat_custom_container.py



Do you have any idea what I might be missing or doing wrong?
Thanks again for your time and help!
Filippo
python3 whereas the command's command-line uses python. But that's likely fine as I'm guessing they alias to the same thing.)tail -f *.log open on the whole XNAT logs directory while you are running the container to see whatever gets logged at that time. To view this discussion visit https://groups.google.com/d/msgid/xnat_discussion/8c8536d0-469c-43f2-a293-8b146615cc2cn%40googlegroups.com.
![]()
Hi John,
Thanks for your suggestions! Unfortunately, I couldn’t find anything useful in the logs.
The issue turned out to be in my Python code, I was copying the entire DICOM folder content, including the scan_ID_catalog.xml file, which was probably causing the issue. The files were present inside the container, but they weren’t visible in XNAT.
I solved it by not copying the files directly, but instead creating a new file inside the NEW-DICOM folder.
Best,
Filippo