[Insight-users] itkSetMacro and itkGetMacro

Sonali Barua barua.sonali at gmail.com
Tue Oct 17 04:26:21 EDT 2006


Hello,

Thank you so much. I was able to resolve that. I read in another old thread
that if you use arrays then the itkSetMacro and itkGetMacro wouldn't work.

I had used itkSetObjectMacro and itkGetObjectMacro as well. It didn't work.

I now have another problem. After resolving most of it I stumbled upon these
types of errors and it seems to be singling out the itkTypeMacro in my code:

[100%] Building CXX object
CMakeFiles/PrimMinimumSpanningTree.dir/PrimMinimumSpanningTree.o
/home/sbarua/GraphAlgorithms/itkGraphTrial/ExamplePipeline4/itkPrimMinimumSpanningTreeGraphFilter.txx:
In constructor
`itk::PrimMinimumSpanningTreeGraphFilter<TGraph>::PrimMinimumSpanningTreeGraphFilter()
[with TGraph = main(int, char**)::GraphType]':
/home/sbarua/GraphAlgorithms/itkGraphTrial/ExamplePipeline4/itkPrimMinimumSpanningTreeGraphFilter.h:31:
instantiated from `static
itk::SmartPointer<itk::PrimMinimumSpanningTreeGraphFilter<TGraph> >
itk::PrimMinimumSpanningTreeGraphFilter<TGraph>::New() [with TGraph =
main(int, char**)::GraphType]'
/home/sbarua/GraphAlgorithms/itkGraphTrial/ExamplePipeline4/PrimMinimumSpanningTree.cxx:84:
instantiated from here
/home/sbarua/GraphAlgorithms/itkGraphTrial/ExamplePipeline4/itkPrimMinimumSpanningTreeGraphFilter.txx:23:
error: non-lvalue in assignment
/home/sbarua/GraphAlgorithms/itkGraphTrial/ExamplePipeline4/itkImageToGraphFilter.txx:
In member function `itk::SmartPointer<itk::DataObject>
itk::ImageToGraphFilter<TInputImage, TOutputGraph,
TImageGraphFunctor>::MakeOutput(unsigned int) [with TInputImage = main(int,
char**)::ImageType, TOutputGraph = main(int, char**)::GraphType,
TImageGraphFunctor = main(int, char**)::ImageToGraphFunctorType]':
/home/sbarua/GraphAlgorithms/itkGraphTrial/ExamplePipeline4/itkImageToGraphFilter.txx:23:
instantiated from `itk::ImageToGraphFilter<TInputImage, TOutputGraph,
TImageGraphFunctor>::ImageToGraphFilter() [with TInputImage = main(int,
char**)::ImageType, TOutputGraph = main(int, char**)::GraphType,
TImageGraphFunctor = main(int, char**)::ImageToGraphFunctorType]'

I don't have any idea what the error means.

-- Sonali.

On 10/17/06, Julien Jomier <julien.jomier at kitware.com> wrote:
>
> Hello Sonali,
>
> The itkSet/GetMacro() works only with standard types (not pointers).
> If you are using smart pointers to define the m_SpanningTree variable
> then you can use the itkSet/GetObjectMacro().
> Otherwise you will have to write your own Set/Get functions.
>
> Let us know if you have any further problems,
>
> Julien
>
> Sonali Barua wrote:
> > Hello,
> >
> > How should I use the itkGetMacro variables of a filter called lets say
> > itkMST. I am writing a filter in which I have the private variable
> > m_SpanningTree. I have a statement called
> >
> > ItkGetMacro(SpanningTree,ParentNodeType);
> >
> > In the .cxx file that I am using as an example I have written the
> statement:
> > MST<ImageType,GraphType>
> > ParentNodeType msp;
> > msp= mst->GetSpanningTree();
> >
> > When I compile this it tells me that it can't recognise the
> > operator=(ParentNodeType*).
> >
> > What exactly should I do to correct this?
> >
> > Sonali
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Insight-users mailing list
> > Insight-users at itk.org
> > http://www.itk.org/mailman/listinfo/insight-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20061017/e00bdf12/attachment-0001.htm


More information about the Insight-users mailing list