<div dir="ltr">Hi Filippo,<div><br></div><div>Yes, those results are odd.</div><div><br></div><div>What is the resulting Spacing and Direction of the itk::Image?</div><div><br></div><div>Thanks,</div><div>Matt</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 1, 2017 at 10:52 AM, Filippo Brogi <span dir="ltr"><<a href="mailto:filippo.brogi@topic.nl" target="_blank">filippo.brogi@topic.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Hello guys,<br>
I'm reading a dicom dataset formed by 17 MR images using ITK 4.9.1.<br>
<br>
According to the documentation  "Origin" is the physical position of the<br>
pixel whose "Index" is all zeros, but the GetOrigin() method is returning<br>
the physical position of index = {0, 0, 16}.<br>
<br>
<br>
Here a simplified code snippet<br>
<br>
        SeriesReaderType::Pointer reader = SeriesReaderType::New();<br>
        ImageIOType::Pointer dicomIO = ImageIOType::New();<br>
        reader->SetImageIO( dicomIO );<br>
<br>
        // mFilenames contains the list of dicom files<br>
        reader->SetFileNames ( mFileNames );<br>
        try<br>
        {<br>
                reader->Update();<br>
<br>
                auto pImage = reader->GetOutput();<br>
<br>
                ShortImageType3D::PointType point1;<br>
                ShortImageType3D::IndexType index1 = {0, 0, 0};<br>
<br>
                pImage-><wbr>TransformIndexToPhysicalPoint( index1, point1 );<br>
<br>
                double imgPos[3];<br>
                imgPos[0] = dicomIO->GetOrigin(0);<br>
                imgPos[1] = dicomIO->GetOrigin(1);<br>
                imgPos[2] = dicomIO->GetOrigin(2);<br>
<br>
                ShortImageType3D::IndexType indexOfOrigin;<br>
                ShortImageType3D::PointType point2;<br>
                point2[0] = imgPos[0];<br>
                point2[1] = imgPos[1];<br>
                point2[2] = imgPos[2];<br>
                pImage-><wbr>TransformPhysicalPointToIndex(<wbr>point2,<br>
indexOfOrigin);<br>
        }<br>
        catch(itk::ExceptionObject &)<br>
        {<br>
                std::cout << "ERROR" << std::endl;<br>
                return res;<br>
        }<br>
<br>
This is the console output:<br>
<br>
GetOrigin (-172.9, -116.666, 55.594)<br>
[-99.3719, -182.98, -25.5239] - index = [0, 0, 0]<br>
[-172.9, -116.666, 55.594] - index = [0, 0, 16]<br>
<br>
Am I doing something wrong?<br>
Thanks in advance<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://itk-users.7.n7.nabble.com/DICOM-Dataset-GetOrigin-tp38167.html" rel="noreferrer" target="_blank">http://itk-users.7.n7.nabble.<wbr>com/DICOM-Dataset-GetOrigin-<wbr>tp38167.html</a><br>
Sent from the ITK - Users mailing list archive at Nabble.com.<br>
______________________________<wbr>_______<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.php" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" rel="noreferrer" target="_blank">http://www.itk.org/Wiki/ITK_<wbr>FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/insight-users" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/insight-users</a><br>
</blockquote></div><br></div>