<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
<b>Indeed, the index is negative.&nbsp; Thanks for the hint!<br>Looking at  itk::ImageFileWriter::Write()</b><br><br><i>&nbsp; // BUG 8436: Wrong origin when writing a file with non-zero index<br>&nbsp; // origin = input-&gt;GetOrigin();<br>&nbsp; const typename TInputImage::IndexType&amp; startIndex = largestRegion.GetIndex();<br>&nbsp; typename TInputImage::PointType origin;&nbsp; <br>&nbsp; input-&gt;TransformIndexToPhysicalPoint(startIndex, origin);<br><br></i><b>A non-zero index explicitely needs to be converted to a new origin.&nbsp; <br>So when using the origin (of an image with non-zero index), one should also pass the index...</b> <b>this is a bit dangerous no?</b><br><b><br>Thanks again,<br>Jef<br><br><br></b>&gt; Subject: Re: [Insight-users] Get and Set itk Origin<br>&gt; From: hobbsk@ohiou.edu<br>&gt; To: jvdmb@hotmail.com<br>&gt; CC: insight-users@itk.org<br>&gt; Date: Tue, 15 Sep 2009 12:57:43 -0400<br>&gt; <br>&gt; On Tue, 2009-09-15 at 09:32 +0000, jef vdmb wrote:<br>&gt; <br>&gt; &gt; The initial input had origin (0,0,0). The output however should have<br>&gt; &gt; an origin different from zero (with the parameters I used for the<br>&gt; &gt; MirrorPadImageFilter). When the output is interrogated for its origin<br>&gt; &gt; (-&gt;GetOrigin() ), it (wrongly) shows all zeros. When writing the image<br>&gt; &gt; afterwards, it was written with the correct origin ( offset field of<br>&gt; &gt; the .mhd image format). <br>&gt; <br>&gt; <br>&gt; I bet that if you get the index of the region of the output image, you<br>&gt; will see that it has negative numbers.<br>&gt; <br>&gt; Only when the image is written is the new origin calculated.<br><br /><hr />Hotmail: Free, trusted and rich email service. <a href='http://clk.atdmt.com/GBL/go/171222984/direct/01/' target='_new'>Get it now.</a></body>
</html>