In my own code when I load a dicom series with pydicom the slices are not necessarily in correct order and the 3 views are often flipped or rotated in a strange way. 3d Slicer seems to always correct it to a standard format where axial is anterior up, sagittal and coronal are superior up, inferior down etc…
Is this specific to slicer or do itk/vtk have some functionality for fixing the orientation of the views to a standard format. The other thing I’m doing is when adding a marker to a ct view it displays it on the 3d model in the RCS coordinate and vice versa. This seems to work perfectly in slicer when adding a point.
I wanted to know if there’s some scripts or samples from slicer or one of the libraries that handles this so I can use it in a small ct/3d model viewer that loads ct views in a standard format and correlates a point placed on either ct or 3d model to each other like in slicer.
DICOM management in general is a complex task. You are free to look through the Slicer source code to see how it’s handled and also to read the documentation. For example here and here.
Creating your own “simple” viewer seems nice in concept, but debugging and ongoing maintenance may be more trouble than it’s worth. We typically suggest instead that such time and effort goes into Slicer extensions or custom Slicer applications so that you take advantage of existing code that already works and ongoing community efforts.
Thanks, in my case it’s already embedded into a larger codebase so I don’t really have the option of extending slicer anymore so I was wondering more if I could pull some code from slicer just to fix this since the viewer is already made I’m just having issues handling the dicom orientations and conversion to 3d model coordinates. If I just run a dicom sample through slicer first before loading into my app everything works pretty well since Slicer must already do some correction so that views are in a consistent orientation.
I’m currently just reading with pydicom and displaying ct with pyqt and the model with vtk. Does ITK have some useful functionality for this instead or is most of it within Slicer exclusively because maybe that’s actually more practical?