I suppose you’re correct. Let’s get into it then, I’m working with (as a start) the MAASTRO Lung1 dataset available on TCIA that you may be familiar with. I downloaded it via the NBIA retriever. Within the dataset each patient has a corresponding folder containing 3 folders: one for the dicom series, one for the RTstruct and one for the segmentation.
My understanding was that running the script included in the “readme” in the command line was meant to convert all of the RT structs (each segmentation within) present in the entire dataset (containing all of the patient folders) into binary mask nrrds that would be stored in the output folder. In short I used the following as guidance(from the readme):
Usage:
[path/]Slicer.exe --no-main-window --python-script [path/]BatchStructureSetConversion.py --input-folder input/folder/path --output-folder output/folder/path
(Optionally use -i and -o instead of the long argument names)
Additional arguments:
–ref-dicom-folder (-r): Folder containing reference anatomy DICOM image series, if stored outside the input study
–use-ref-image (-u): Use anatomy image as reference when converting structure set to labelmap
–exist-db (-x): Process an existing database instead of importing data in a new one (in this case --input-folder is a database and not a folder containing DICOM data)
–export-images (-m): Export all image data alongside the labelmaps to NRRD
Because the folder housing all the patient folders contains both the structs and dicom series I did not use a dicom reference folder or reference image. I did use -m because I figured it may be more convenient for future implementation if it worked.
Upon running the script I found that only the segmentations from (what appears to be) the first patient appeared “LUNG-001” in the output folder, rather than nrrds for the RT struct of every patient. It’s possible that there was an error but I found it difficult to troubleshoot without error messages. I will say that upon examining the generated output for this singular patient, I was very happy with the quality of conversion!
Beyond the error, the file names produced by the script do not lend themselves to facile interpretation and every contour from the RT struct is saved as a separate file whereas I’m seeking to only extract the gross tumour volume (GTV). Granted, this is a very minor issue as I could filter out the unnecessary files out afterwards and computation efforts are not a significant for me in this case.
Let me know what further information I can provide or if I’ve misinterpreted the use-case of the script that I employed as I am somewhat of a neophyte when it comes to this stuff.
Thanks!
Other information:
System: Windows 10 pro
Slicer version: 4.11.20200930