[Insight-users] managedITK, converting itkImage to vtkImage

Shady Shidfar shady_shidfar at yahoo.com
Thu Jul 3 08:20:29 EDT 2008


Hi everyone, I need help with managedITK(ITK .net). I've just started using managedITK instead of using ITK, c++ and FLTK and it's very very cool. I hope I won't need to go back to FLTK anymore. Anyway I'm trying to read an image , create an itkImage, export it to VTK and then view it. Everything's fine when I have a unsigned char itkImage (itkImage_UC3)  and accordingly itkImageToVTKImageFilter_IUC3 but when I change the image and filter into signed type; itkImage_SS3 and  
ERROR: In m:\dev\cur\vtkdotnet\branch\50\Rendering\vtkImageActor.cxx, line 182
vtkOpenGLImageActor (064064D8): This filter requires unsigned char scalars as inputDoes anyone know what's the problem and how can I have a unsigned image and convert it to vtkImage using ManagedITK and VTK.net ofcourse?
Thank you and here's the code (in visual c#):{classHSImageprivatestringID; // name of the object not set yetpublicHSImage(stringimagePathName)publicvoidsetImageName(stringimageName)this.imageName = imageName;publicstringgetImageName()returnthis.imageName;publicvoidsetImagePath(stringimagePath)this.imagePath = imagePath;publicstringgetImagePath()returnthis.imagePath;publicvoidsetImagePathName(stringimagePathName)this.imagePathName = imagePathName;publicstringgetImagePathName()returnthis.imagePathName;{privatevoidsetImagebase(stringimagePath)//this.imageBase = itkImage_UC3.New();}this.imageBase = itkImage_SS3.New();this.imageBase.Read(imagePathName);
{
setImagePathName(imagePathName);
setImageName(extractImageName(imagePathName));
setImagePath(extractImagePath(imagePathName));
setImagebase(imagePath);
setImageInfo(imagePath);
}
{
}
{
}
{
}
{
}
{
}
{
}
 privatestringimageName;privatestringimagePath;privatestringimagePathName;privateitkImageBaseimageBase;privateitkPixelTypepixelType;privateuintdimension;privateitkSizesize;privateitkSpacingspacing;privateitkPointorigin;{publicvtkImageActorconvertITKImageToVTKObject()
vtkImageActorvtkImageActor1 = newvtkImageActor();itkImageToVTKImageFilter_ISS3filter = itkImageToVTKImageFilter_ISS3.New();filter.SetInput(
vtkImageActor1.SetInput(filter.GetOutput());this.getImagebase());return(vtkImageActor1);
}
}itkImageToVTKImageFilter_ISS3,I get the error : 


      __________________________________________________________
Not happy with your email address?.
Get the one you really want - millions of new email addresses available now at Yahoo! http://uk.docs.yahoo.com/ymail/new.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20080703/420da206/attachment.htm>


More information about the Insight-users mailing list