AW: [vtkusers] Changing vtkStructuredPoints scalar type
Oliver Burgert
burgert at ira.uka.de
Fri Apr 5 02:04:48 EST 2002
vtkImageCast ! ;-)
short example...
HTH Oliver
//The Data which will be rendered
vtkImageData *RenderImage = vtkImageData::New();
//if volume data is not UNSIGNED_CHAR or UNSIGNED_SHORT
//volume has to be casted to the desired range
if ((p_Image->GetScalarType() != VTK_UNSIGNED_CHAR ) &&
(p_Image->GetScalarType() != VTK_UNSIGNED_SHORT ))
{
GfxPrint("Resampling volume");
vtkImageCast* pImageCast = vtkImageCast::New();
pImageCast->SetOutputScalarTypeToUnsignedShort();
pImageCast->ClampOverflowOn();
pImageCast->SetInput(p_Image);
RenderImage=(pImageCast->GetOutput());
RenderImage->Update();
GfxPrint("Resampling done");
} //resampling
else
{
RenderImage = p_Image;
}
> -----Ursprüngliche Nachricht-----
> Von: John Biddiscombe [mailto:jbiddiscombe at skippingmouse.co.uk]
> Gesendet: Donnerstag, 4. April 2002 23:16
> An: VTK Mailing list; Robb Brown
> Betreff: Re: [vtkusers] Changing vtkStructuredPoints scalar type
>
>
> vtkImageCast ?
>
> ----- Original Message -----
> From: "Robb Brown" <brownr at ucalgary.ca>
> To: "VTK Mailing list" <vtkusers at public.kitware.com>
> Sent: Thursday, April 04, 2002 5:45 PM
> Subject: [vtkusers] Changing vtkStructuredPoints scalar type
>
>
> >
> > I have a vtkStructuredPoints file with ScalarType set to unsigned
> > char. I want to convert this file so that ScalarType is short. How
> > would I do this? I tried reading it, using SetScalarTypeToShort()
> > then writing it and I do get a larger file but upon reading the file
> > again GetScalarTypeAsString still reports unsigned char.
> >
> > Thanks,
> >
> > Robb
> > --
> > ______________________________
> > Robb Brown
> > Seaman Family MR Research Centre
> > Calgary, Alberta, Canada
> > _______________________________________________
> > This is the private VTK discussion list.
> > Please keep messages on-topic. Check the FAQ at:
> <http://public.kitware.com/cgi-bin/vtkfaq>
> > Follow this link to subscribe/unsubscribe:
> > http://public.kitware.com/mailman/listinfo/vtkusers
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
More information about the vtkusers
mailing list