[Insight-developers] Fwd: Possible bug in ITK
Bill Hoffman
bill.hoffman@kitware.com
Wed, 11 Sep 2002 10:10:21 -0400
--=====================_1122844224==_.ALT
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
>Date: Wed, 11 Sep 2002 15:49:40 +0200
>Subject: Possible bug in ITK
>From: Jahn Otto Næsgaard Andersen <Jahn.O.Andersen@unimed.sintef.no>
>To: bill.hoffman@kitware.com
>X-Mailer: Apple Mail (2.543)
>
>Hi, I have discovered a possible bug in itk:: CastImageFilter.
>
>
>Given this code (run on Mac OS X):
>
>
>// Import data from VTK to ITK (using my own VtkToItkGateway class)
>VtkToItkGateway<unsigned char>* vtk2itk = new VtkToItkGateway<unsigned char>(this->input);
>
> printf("gatewayed size: %i, %i, %i\n", vtk2itk->GetOutput()->GetLargestPossibleRegion().GetSize().GetSize()[0], vtk2itk->GetOutput()->GetLargestPossibleRegion().GetSize().GetSize()[1], vtk2itk->GetOutput()->GetLargestPossibleRegion().GetSize().GetSize()[2]); // Shows correct size
>
> // Convert input data to float
> itk::CastImageFilter<UCharImageType, FloatImageType>::Pointer uchar2float = itk::CastImageFilter<UCharImageType, FloatImageType>::New();
> uchar2float->SetInput(vtk2itk->GetOutput());
>
> printf("casted size: %i, %i, %i\n", uchar2float->GetOutput()->GetLargestPossibleRegion().GetSize().GetSize()[0], uchar2float->GetOutput()->GetLargestPossibleRegion().GetSize().GetSize()[1], uchar2float->GetOutput()->GetLargestPossibleRegion().GetSize().GetSize()[2]); // Shows incorrect size (0,0,0)
>
>
>It seems like the image size is not copied into the CastImageFilter output. What do you think?
>
>
>Jahn Otto
>
></blockquote></x-html>
--=====================_1122844224==_.ALT
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
<html>
<br>
<blockquote type=cite class=cite cite>Date: Wed, 11 Sep 2002 15:49:40
+0200<br>
Subject: Possible bug in ITK<br>
From: Jahn Otto Næsgaard Andersen
<Jahn.O.Andersen@unimed.sintef.no><br>
To: bill.hoffman@kitware.com<br>
X-Mailer: Apple Mail (2.543)<br>
<br>
Hi, I have discovered a possible bug in itk:: CastImageFilter. <br>
<br>
<br>
Given this code (run on Mac OS X): <br>
<br>
<br>
// Import data from VTK to ITK (using my own VtkToItkGateway class)
<br>
<tt>VtkToItkGateway<<font color="#760F50">unsigned</font>
<font color="#760F50">char</font>>* vtk2itk = <font color="#760F50">new</font> VtkToItkGateway<<font color="#760F50">unsigned</font> <font color="#760F50">char</font>>(<font color="#760F50">this</font>->input); <br>
<br>
printf(<font color="#891315">"gatewayed size: %i, %i, %i\n"</font>, vtk2itk->GetOutput()->GetLargestPossibleRegion().GetSize().GetSize()[<font color="#0000FF">0</font>], vtk2itk->GetOutput()->GetLargestPossibleRegion().GetSize().GetSize()[<font color="#0000FF">1</font>], vtk2itk->GetOutput()->GetLargestPossibleRegion().GetSize().GetSize()[<font color="#0000FF">2</font>]); // Shows correct size <br>
<br>
<font color="#236E25">// Convert input data to float</font> <br>
itk::CastImageFilter<UCharImageType, FloatImageType>::Pointer uchar2float = itk::CastImageFilter<UCharImageType, FloatImageType>::New(); <br>
uchar2float->SetInput(vtk2itk->GetOutput()); <br>
<br>
printf(<font color="#891315">"casted size: %i, %i, %i\n"</font>, uchar2float->GetOutput()->GetLargestPossibleRegion().GetSize().GetSize()[<font color="#0000FF">0</font>], uchar2float->GetOutput()->GetLargestPossibleRegion().GetSize().GetSize()[<font color="#0000FF">1</font>], uchar2float->GetOutput()->GetLargestPossibleRegion().GetSize().GetSize()[<font color="#0000FF">2</font>]); // Shows incorrect size (0,0,0) <br>
</tt><br>
<br>
It seems like the image size is not copied into the CastImageFilter output. What do you think? <br>
<br>
<br>
Jahn Otto <br>
<br>
</blockquote></x-html> </blockquote></html>
--=====================_1122844224==_.ALT--