Closed sama2689 closed 3 years ago
@carluri is this something you want to be supporting? It was written under the assumption that we would always the actual DCM files associated with the RT-STUCTS as there is quite a bit of information you need from the DCM files to generate the RT struct.
If you wanted to change this this should point you in the right direction:
C:\Users\cadam\programming\rt-utils>git grep -n SliceLocation
rt_utils/image_helper.py:25: series_data.sort(key=lambda ds: ds.SliceLocation, reverse=False)
rt_utils/image_helper.py:138: z_indicies = np.ones((contour.shape[0], 1)) * series_slice.SliceLocation
I'm getting the same error when using RTStructBuilder.create_new(dicom_series_path='/path')
with an existing DICOM series. I notice that SliceLocation is an optional attribute, could the same sorting information be obtained from ImagePositionPatient?
I came here from @pchlap's comment in https://github.com/qurit/rt-utils/pull/21#issue-641906262. I vendored into PyMedPhys some code by @Fincap and @sjswerdloff that achieves this.
The code that does this sorting within PyMedPhys is over at:
The original code is over at:
And the relicensing discussion occurred over at:
https://github.com/pymedphys/pymedphys/pull/1458#discussion_r598630630
To add onto this @johndgiese over at innolitics also has a similar solution to this:
Hi, I'm having the same issue rasterizing structures on some CT series that are missing the optional SliceLocation attribute. It's possible to sanitize our files in the short term, but in the future it would be great to rely on ImagePositionPatient.
I have an rt-struct.dcm file by itself, I want to extract a 3D volumetric mask from this. From loading the Rt-struct using dicominfo on MATLAB I can see that it has no SliceLocation attribute. However, it does have ROI contour attributes. All I am trying to do is extract these ROI contours (which are currently stored in Cartesian coordinates) as a mask. Is it possible to do this with rt-utils?