I annotated a big dataset (for me), but the Dicom file of the CT scan has transformed (I get this from start).
when I use this segment in Python by simpleITK [The problem post] it will not match with the CT image because the CT image that simpleITK can read is raw Dicom file not Dicom transformed.
so I want to fix this problem by doing something with the segment after trying to do something with Dicom.
but I can’t find a way to transform segmentation.
The acquisition transform accounts for irregularity in the spacing and other issues with the geometry. You can right click on the icon in the transform column and pick the “Harden transform” option to resample. You probably want also apply the transform and harden the segmentation.
I think this way will work.
I try on one Dicaom and on Segment
but when ‘Harden transform’ on Dicom some side of the image is out of ‘View Box’, and some side do not reach the side of the box. then when I read it the shape is (80, 613, 512)
for more context, I draw a little thing.
How to crop this?
First CT Dicom shape → (82, 512, 512)
Segment shape → (82, 512, 512)
CT Dicom Harden transform’ shape → (80, 613, 512)
Need to fix:
- missing slide
- crop slide in to Box
Probably you can use CropVolume for this. If you can sort it out please include some screenshots to illustrate what’s not working for you.
Thank you very much now I find a way to manage with this problem.
my problem: Creating a segmentation dataset with CT has transformed. but Python cant read the CT transform and can only read raw CT.
so I solve it by creating an inverted transform segmentation.
for more details:
- I have CT .dcm with transformed. and have segmentation nrrd.
- Import segmentation as volume.
- Clone transform form CT to segmentation volume.
- Invert transform and Edit properties to apply to segmentation volume.
- then “Harden transform” segmentation.
and save it as dicom.
for the shape problem that will change I slove in Python (just cut it off):
# read dicom filse (CT, mask)
ct_image_array = readCT(dir_ct_paths[n])
label_image_array = readLabel(dir_label_paths[n])
# preprocess mass
label_image_array = label_image_array[:ct_image_array.shape, :512, :512]