[vtkusers] vtkImageChangeInformation changes ScalarType?

Bill Lorensen bill.lorensen at gmail.com
Wed Feb 28 08:18:33 EST 2007


Are you sure that your ImageChangeInformation is connected to the
Volume16Reader?

Bill


On 2/27/07, Michael Knopke <Michael.Knopke at gmx.de> wrote:
>
> Hi,
>
> I just noticed that using vtkImageChangeInformation in my pipeline always
> changes the ScalarType to double, before the type was unsigned_short
>
> even when calling vtkImageCast->SetOutputScalarTypeToUnsignedShort();
>
> the scalartype is still double. Very Strange.
>
> Code:
>
> v16 = vtkVolume16Reader::New();
>
> v16...extend and spacing
>
> v16->GetOutput()->GetScalarTypeAsString(); // returns unsigned_short
>
> image_Change = vtkImageChangeInformation::New();
> image_Change->CenterImageOn();
>
> image_Change->GetOutput()->GetScalarTypeAsString(); // returns double
>
> image_Cast = vtkImageCast::New();
> image_Cast->SetOutputScalarTypeToUnsignedShort();
>
> image_Cast->GetOutput()->GetScalarTypeAsString(); //returns double???
>
> The reason I use GetOutput() and not as proposed for new standard
> GetOutputPort() is that some classes (like vtkImagePlaneWidget) don't
> support setting a port but use direct access to imageData ( via
> ->SetInput())
>
> So using vtkImageChangeInformation with vtkImagePlaneWidget as input will
> give a wrong reslice (white output) because the datatype changed. Using v16
> directly works.
>
> Regards
>
> Michael
>
>
>
> --
> "Feel free" - 5 GB Mailbox, 50 FreeSMS/Monat ...
> Jetzt GMX ProMail testen: www.gmx.net/de/go/mailfooter/promail-out
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070228/eb89adc5/attachment.htm>


More information about the vtkusers mailing list