<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. Thanks for the hint!<br>Looking at itk::ImageFileWriter::Write()</b><br><br><i> // BUG 8436: Wrong origin when writing a file with non-zero index<br> // origin = input->GetOrigin();<br> const typename TInputImage::IndexType& startIndex = largestRegion.GetIndex();<br> typename TInputImage::PointType origin; <br> input->TransformIndexToPhysicalPoint(startIndex, origin);<br><br></i><b>A non-zero index explicitely needs to be converted to a new origin. <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>> Subject: Re: [Insight-users] Get and Set itk Origin<br>> From: hobbsk@ohiou.edu<br>> To: jvdmb@hotmail.com<br>> CC: insight-users@itk.org<br>> Date: Tue, 15 Sep 2009 12:57:43 -0400<br>> <br>> On Tue, 2009-09-15 at 09:32 +0000, jef vdmb wrote:<br>> <br>> > The initial input had origin (0,0,0). The output however should have<br>> > an origin different from zero (with the parameters I used for the<br>> > MirrorPadImageFilter). When the output is interrogated for its origin<br>> > (->GetOrigin() ), it (wrongly) shows all zeros. When writing the image<br>> > afterwards, it was written with the correct origin ( offset field of<br>> > the .mhd image format). <br>> <br>> <br>> I bet that if you get the index of the region of the output image, you<br>> will see that it has negative numbers.<br>> <br>> 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>