-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: origin is outside image geometry #430
Comments
Note that I do not get this error when I use a different series as the input. |
Not being 100% sure, from the second dimension value of the mapped index |
Can you try setting the locale to C before calling the DCMQI code? |
Tried it, no success. |
@yigitsoy I tried the sample code you shared on a public dataset, and I am not able to reproduce the issue you reported. Can you either share a de-identified dataset, or (ideally) reproduce the issue on a public dataset? |
@fedorov thanks for trying it out. Unfortunately I cannot share the dataset. Furthermore, it is hard to reproduce on another dataset. I tried on different series we have and it worked just fine. I will try to reproduce this on a public dataset and share it. |
I'm hitting the same issue and started from this issue.
this is now here Indeed there is something going on with the rounding or even more. I've applied the following changes: --- a/libsrc/Dicom2ItkConverter.cpp
+++ b/libsrc/Dicom2ItkConverter.cpp
@@ -139,14 +139,17 @@ itk::SmartPointer<ShortImageType> Dicom2ItkConverter::nextResult()
m_groupIterator = m_segmentGroups.end();
return nullptr;
}
- if (!itkImage->TransformPhysicalPointToIndex(frameOriginPoint, frameOriginIndex))
- {
- cerr << "ERROR: Frame " << framesForSegment[frameIndex] << " origin " << frameOriginPoint
- << " is outside image geometry!" << frameOriginIndex << endl;
- cerr << "Image size: " << itkImage->GetBufferedRegion().GetSize() << endl;
- m_groupIterator = m_segmentGroups.end();
- return nullptr;
- }
+
+ slicer_itk::ContinuousIndex<double, 3> frameOrigin_cidx = itkImage->TransformPhysicalPointToContinuousIndex<double>(frameOriginPoint);
+ cerr << "Frame " << framesForSegment[frameIndex] <<
+ " Origin " << frameOriginPoint <<
+ " | Index: " << frameOrigin_cidx <<
+ " | Spacing: " << m_computedSliceSpacing << endl;
+ // if (!itkImage->TransformPhysicalPointToIndex(frameOriginPoint, frameOriginIndex))
+ // {
+ // m_groupIterator = m_segmentGroups.end();
+ // return nullptr;
+ // }
// Handling differs depending on whether the segmentation is binary or fractional
// (we have to unpack binary frames before copying them into the ITK image)
const DcmIODTypes::Frame* rawFrame = m_segDoc->getFrame(framesForSegment[frameIndex]); I have a lot of DICOMSeg, but here is an example output:
For all objects, the origin of the first or last frame is perfectly fine (index [0,0,0]) but then is diverges. It seems the direction matrix in the individual segmentation set (if there's even any) does not match with the info used to init the ITK image. However it's hard to make any sense of the missmatch, as the error is really not linear. For now I will disable the check and compare the data obtained with DCMSeg to data exported with OpenIGTLink. |
It looks like the jitter is on the order of 0.5 mm, so maybe this is the issue of rounding? But if this is the case, it is a problem with the data. If individual frames have inconsistent origin, then I don't know what tool can make sense out of this to reconstruct a volume. @d-vogel any chance you can bring this up with the BrainLab folks and ask for an explanation? |
Hi,
I have been trying to load DICOM SEG object to Slicer (Slicer-4.13), with the DCMQI extension. The GUI reports that it cannot be loaded. Then, when I try to convert the DICOM SEG using the following command
I get an error about the image origin, as the following
Row direction: 1 0 0 Col direction: 0 0.995396 -0.0958457 Z direction: -0 0.0958457 0.995396 Total frames: 10 Total frames with unique IPP: 10 Total overlapping frames: 0 Origin: [-118, -29.0505, -684.721] Failed to get CIELab values - initializing to default 43803,26565,37722 Failed to get CIELab values - initializing to default 43803,26565,37722 Failed to get CIELab values - initializing to default 43803,26565,37722 Failed to get CIELab values - initializing to default 43803,26565,37722 ERROR: Frame 3 origin [-118, -29.0505, -682] is outside image geometry![0, -1, 3] Image size: [512, 512, 10] Fatal error encountered. vtkDebugLeaks has found no leaks
Here is a basic script how I use highdicom to create the DICOM SEG object
It would be great if you could provide some pointers as to where the problem could be. Thank you.
The text was updated successfully, but these errors were encountered: