Hi all,
Do any of you know a way to transfer DICOM files quickly to an external storage unit while keeping the original protocol names in a Siemens Prisma scanner?
Those of you who are familiar with the Tim Trio will recall that you could transfer files to an external storage unit while reserving the protocol names and series numbers. For example, sending a file to the USB would retain the protocol name exactly as it was written on the exam view window.
However, in Prisma the files are transferred in bulk and each folder contains exactly 500 files, this makes it very difficult to know which fMRI run is in which folder, etc. The scanner’s software version is MR XA30.
It is possible to send files one by one by creating a new folder for each protocol seperately, but this requires lots of attention and is prone to error.
How Siemens exports the data depends on whether you do “export” or (from a different menu) “export to offline”. Anyhow, you can perhaps try to run my dicomsort utility, which saves the data in the console format you want ([SeriesNumber]_[SeriesDescription]). See:
https://bidscoin.readthedocs.io/en/latest/preparation.html#supported-source-data-structures
And
https://bidscoin.readthedocs.io/en/latest/utilities.html#dicomsort
To get the protocol names written into the dicom files, you need to change the DICOM Study Description in your scanner administration portal, under DICOM Data Handling. This will let you change the default from Region^Examination to Region^Examination^Protocol. Pre VA30, that would get written with the caret symbol as separator, but after VA30 it’s a space (I recommend avoiding spaces in exam and protocol names if you want to parse this field).
Once you’ve transferred the files then you can use another script to sort them by this field and the series number. The one we use is similar to the one in my “mrpyconvert” github repo called “dicom_sorter.py”: mrpyconvert/mrpyconvert/dicom_sorter.py at main · Jolinda/mrpyconvert · GitHub.
We have it set up to autotransfer all files during the night to a server running storescp from dcmtk (DCMTK - dicom.offis.de). The command we use is:
storescp --output-directory <incoming directory> -xcs python3 dcmsort.py #p <main repo directory> -tos 30 -pm -sp -fe .dcm +xa -aet <aettitle> <port>
The -xcs flag is “exec on end of study”; end of study is when no dicoms from the same study have been received after the -tos flag (30 seconds). Dicoms are sorted by region->examination->protocol->subject_date_time->series. We use the region and examination fields to specify which research group owns the protocol, then have permissions on the server set so that each research group can see only their own files.
We’ve had this system for years and it works great. One thing to note is that storescp cannot handle multiple simultaneous associations, so if you have multiple scanners stagger the times that they are sending the DICOMS to avoid timeouts.
@Marcel_Zwiers @Jolinda Thank you both for your answers and sharing these tools. I will definitely look into them.