[Insight-users] How to get gradient vector image?

Sergio Vera sergio.vera at alma3d.com
Thu Apr 7 11:13:45 EDT 2011


Hi, Melanie.

Use The metaheader format (.mha or mhd) with itkImageFileWriter. They can
handle the covariant vector image type. No idea of Nrrd supports covariant
vectors

Regards

On Thu, Apr 7, 2011 at 5:10 PM, Melanie Uks <meluks2010 at googlemail.com>wrote:

> I tried to design an example for the GradientRecursiveGaussianImageFilter.
> Now I have a problem finding a file format for the
> "CovariantVector"-OutputImage. I tried to use nrrd :
>
>     itk::NrrdImageIO::Pointer io = itk::NrrdImageIO::New();
>     //io->SetNrrdVectorType( nrrdKindList );
>     io->SetFileType( itk::ImageIOBase::ASCII );
>
>     //create the reader and writer
>      ReaderType::Pointer reader = ReaderType::New();
>      WriterType::Pointer nrrdWriter = WriterType::New();
>
>     //recover file names from command line arguments
>     const char * inputFilename  = argv[1];
>     const char * outputFilename = argv[2];
>
>     reader->SetFileName( inputFilename  );
>     nrrdWriter->UseInputMetaDataDictionaryOn();
>     nrrdWriter->SetImageIO(io);
>     nrrdWriter->SetFileName(outputFilename);
>
>     //  processing pipeline:
>     filter->SetInput( reader->GetOutput() );
>     nrrdWriter->SetInput( filter->GetOutput() );
>
>     try
>     {
>         //execute the pipeline
>         nrrdWriter->Update();
>     }
>     catch( itk::ExceptionObject & err )
>     {
>         std::cerr << "ExceptionObject caught !" << std::endl;
>         std::cerr << err << std::endl;
>         return EXIT_FAILURE;
>     }
>
> This didn't work! I guess the following part would help (copied from here<http://www.itk.org/Wiki/Getting_Started_with_the_NRRD_Format>
> )
>
>   itk::NrrdImageIO::Pointer io = itk::NrrdImageIO::New();
>   // This statement is to be added to the ITK CVS Release
>   *io->SetNrrdVectorType( nrrdKindList )*;
>   io->SetFileType( itk::ImageIOBase::ASCII );
>
> But it was not possible because "SetNrrdVectorType" does not exist...
>
> Anyway: is there a file format to save vector images and how to do???
>
> Thanks for your help!
>
> Melanie
>
>
>
> 2011/4/5 Melanie Uks <meluks2010 at googlemail.com>
>
>> Ok, I try to. I will contact you, if I need help for the example...
>> Melanie
>>
>>
>> 2011/4/5 David Doria <daviddoria at gmail.com>
>>
>>> On Tue, Apr 5, 2011 at 5:32 AM, Sergio Vera <sergio.vera at alma3d.com>wrote:
>>>
>>>> Hi, Melanie
>>>> Indeed, using that filter you will obtain only the gradient magnitude.
>>>>
>>>> If you need the gradient as a vector image, use
>>>> http://www.itk.org/Doxygen320/html/classitk_1_1GradientRecursiveGaussianImageFilter.html#_details for
>>>> instance
>>>>
>>>> regards
>>>>
>>>
>>> Melanie,
>>>
>>> It looks like we do not have an example
>>> of GradientRecursiveGaussianImageFilter. If you could add one here:
>>>
>>> http://www.itk.org/Wiki/ITK/Examples#Image_Edges.2C_Gradients.2C_and_Derivatives
>>>
>>>
>>> <http://www.itk.org/Wiki/ITK/Examples#Image_Edges.2C_Gradients.2C_and_Derivatives>once
>>> you get this working it would be a great help.
>>>
>>> David
>>>
>>
>>
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>


-- 
Sergio Vera

 Alma IT Systems
 C/ Vilana, 4B, 4º 1ª
 08022 Barcelona
 T. (+34) 932 380 592
 www.alma3d.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110407/fba7f917/attachment-0001.htm>


More information about the Insight-users mailing list