SlicerRt / SlicerRT

Open-source toolkit for radiation therapy research, an extension of 3D Slicer. Features include DICOM-RT import/export, dose volume histogram, dose accumulation, external beam planning (TPS), structure comparison and morphology, isodose line/surface generation, etc.
https://slicerrt.org
126 stars 60 forks source link

The binary labelmap is cropped after using the batchprocessing. #183

Closed itruonghai closed 3 years ago

itruonghai commented 3 years ago

Dear author, I try to convert all of my RTStruct file to the NIFTI ones. I try to use the BatchStructureSetConversion.py to convert, but the final labelmap is cropped (change the width and height). Here is my script

./Slicer --no-main-window --python-script ./test.py --input-folder input  --output-folder output -m

In my input folder, there are Dicom and RTStruct (DicomRT) files. I already try to add the flag -r and split the input folder into dicom and dicomrt, but the labelmap is just a frame (although maintain the width and height). Hope you can help me to solve this problem.
Here is the screenshot of labelmap. https://ibb.co/5cv62Lc
https://ibb.co/7W6wL1Z Note that the labelmap is 57x54x66 and the dicom is 512x512x132.

cpinter commented 3 years ago

Have you tried using a reference image? See https://github.com/SlicerRt/SlicerRT/blob/master/BatchProcessing/_readme.txt#L9

itruonghai commented 3 years ago

Have you tried using a reference image? See https://github.com/SlicerRt/SlicerRT/blob/master/BatchProcessing/_readme.txt#L9

I have already add flag -u into my script, but the .nii file at the end just have only 1 frame (the width and the height is 512x512). Can you have me to deal with that problem, sir?

itruonghai commented 3 years ago

@cpinter I see the volumn of refVolumn, and it has only 1 frame. I think that is the reason why when I activate flag -u, the final nii file have only 1 frame. My input folder is contain all of DCM file and DCM RT file, is this the reason?

cpinter commented 3 years ago

If you use a DICOM volume with one slice per volume, then you either need to make sure that all the slices are in the same folder as the RTSS file, or you need to specify the folder in which they are, see here.

itruonghai commented 3 years ago

@cpinter My folder contains of all dicom image (per slice) with the prefix MR and a dicom rt with the prefix RS. You can see in the picture. How can I format it? https://ibb.co/vdVZyNX