platipy icon indicating copy to clipboard operation
platipy copied to clipboard

Error when reshaping contour array in transform_point_set_from_dicom_struct

Open MarkGardnerUSyd opened this issue 1 year ago • 1 comments

This might be a bit of a weird error but I ran process_dicom_directory with a dicom structure set with ct and struct dicom files and got the following error:

process_dicom_directory(dicomDir, output_directory= outputDir) File "~\platipy\platipy\dicom\io\crawl.py", line 923, in process_dicom_directory for ( File "~\platipy\platipy\dicom\io\crawl.py", line 667, in process_dicom_series ) = transform_point_set_from_dicom_struct(image, dicom_object) File "~\platipy\platipy\dicom\io\crawl.py", line 318, in transform_point_set_from_dicom_struct vertexArr_physical = struct_slice_contour_data.reshape( ValueError: cannot reshape array of size 239 into shape (79,3)

This hasn't happened for other patient data in the dataset, and it seems like a really odd thing as if they are coordinates they should be divisible by 3? Anyway not sure if anyone has encountered anything similar.

MarkGardnerUSyd avatar May 04 '23 03:05 MarkGardnerUSyd

Thanks for reporting this @MarkGardnerUSyd. I haven't seen this error before, but I must admit that the DICOM crawler in platipy isn't really being maintained anymore... We are starting to move towards an add-on library we've been making called pydicer: https://github.com/AustralianCancerDataNetwork/pydicer

But this error does look like there might be an issue with that structure set... As you say it expects the coordinates to be divisible by 3 because the contour points come in a list of [x, y, z, x, y, z, x, y, z...].

pchlap avatar May 08 '23 20:05 pchlap