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

Melanie Uks meluks2010 at googlemail.com
Thu Apr 7 11:10:44 EDT 2011


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
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110407/061d4592/attachment.htm>


More information about the Insight-users mailing list