Hi Miri, one "unsigned" is enough in the typedef.
You can just skip the first half of the code, since as I see, you cast the MITK image to ITK, and then back. So you are again where you started from. Best, Miklos On Thu, Nov 10, 2011 at 2:35 PM, Miri Trope <[email protected]> wrote: > Hi all, > > I'd like to share with you my successful results in order to close this > discussion: > > The flow chart which describes the ability to get an mitk image, manipulate > some vtk's filters and return an mitk image (in order to view the result) > is: > mitk image-> *(itk image -> mitk image) -> vtk image -> mitk image > > * The convert from mitk to mitk via itk is in order to convert from a const > pointer that returned from this->getInput(0) when trying to generate > data. > > > * If you think that there are better ways to do that task, I'd love to hear > about that ... :-) > Thanks again to those that helped me to figure this out ... > > void myModule::MyFunction( mitk::Image::Pointer outputImage) > > { > > typedef unsigned unsigned short InputPixelType; > typedef itk::Image < InputPixelType, 3> InputImageType; > itk::Image< InputPixelType, 3>::Pointer itkImage; > > //make itk image to manipulate the mitk const input image > mitk::CastToItkImage(m_InputImage, itkImage); // m_inputImage is a const > pointer member of myModule class > > //create a non-const pointer to mitk input image > mitk::Image::Pointer mitkInputImage = mitk::Image::New(); > > //transfer data from images > mitk::CastToMitkImage(itkImage, mitkInputImage); > > //make vtk image > vtkImageData* vtkImage = mitkInputImage->GetVtkImageData(); > > // a vtk's filter manipulation for example: > vtkImageGaussianSmooth* smooth = vtkImageGaussianSmooth::New(); > smooth->SetInput(vtkImage); > smooth->GetOutput()->Update(); > > //make an output mitk image > outputImage->Initialize(smooth->GetOutput()); > outputImage->SetVolume(smooth->GetOutput()->GetScalarPointer()); > outputImage->Update(); > } > > void myModule::GenerateData() > > { > m_InputImage = this-> GetInput(0); > mitk::Image::Pointer outputImage = this->GetOutput(); > MyFunction(outputImage); > } > > > Best, > Miri > > > > On Thu, Nov 3, 2011 at 8:04 AM, Miri Trope <[email protected]> wrote: >> >> as a continue to section two- regarding the conversion of itk to vtk, the >> error is: >> >> c:\mitk_myprojects\modules\mymodulelib\itkImageToVTKImageFilter.txx(106) : >> error C2244: 'itk::VTKImageToImageFilter<TOutputImage>::GetImporter' : >> unable to match function definition to an existing declaration >> 1> >> c:\mitk_myprojects\modules\mymodulelib\itkVTKImageToImageFilter.h(80) : see >> declaration of 'itk::VTKImageToImageFilter<TOutputImage>::GetImporter' >> 1> definition >> 1> 'const VTKImageToImageFilter<TOutputImage>::Superclass >> *itk::VTKImageToImageFilter<TOutputImage>::GetImporter(void) const' >> 1> existing declarations >> 1> 'itk::VTKImageImport<TOutputImage> >> *itk::VTKImageToImageFilter<TOutputImage>::GetImporter(void) const' >> >> >> please help me to figure this out or suggest another way to do this... >> >> On Wed, Nov 2, 2011 at 3:57 PM, Miri Trope <[email protected]> wrote: >>> >>> My previous post deserves a new post, so I'll ask again: >>> >>> I'd like to insert my code that include VTK's filters, but I don't find a >>> way to convert my mitk input image to vtk. >>> >>> I've tried to: >>> 1. use the method: AccessIntegralPixelTypeByItk and get the image like >>> this: >>> void myFunc(itk::Image<Tpixel, dimention>*image, mitk::Image::Pointer >>> outputImage) and simply use ITK filters. >>> Is there a similar way to access mitk image by vtk (like >>> AccessIntegralPixelTypeByItk but to vtk) >>> >>> 2. Use AccessIntegralPixelTypeByItk and afterwards convert itk image to >>> vtk image. >>> I tried to use the filer: >>> itkImageToVTKImageFilter which call to itkVTKImageToImageFilter but an >>> error returned: error C2244. >>> >>> Are there better ways to do this? >>> >>> >>> Thanks. > > > ------------------------------------------------------------------------------ > RSA(R) Conference 2012 > Save $700 by Nov 18 > Register now > http://p.sf.net/sfu/rsa-sfdev2dev1 > _______________________________________________ > mitk-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/mitk-users > > ------------------------------------------------------------------------------ RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 _______________________________________________ mitk-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mitk-users
