[Insight-users] discards qualifiers ...

Lagaffe lagaffe74130 at yahoo.fr
Fri Sep 30 12:52:00 EDT 2005


Hi Luis,
you right it was stupid, I changed my code to set to
identity a matrix   (and not the getOutput of the
filter) if the covariance cannot be evaluated ...
thanks,
Arnaud


--- Luis Ibanez <luis.ibanez at kitware.com> a écrit :

> 
> Hi Lagaffe,
> 
> In general in ITK a GetOutput() method returns a
> "const" object.
> The reason is that the results of a filter and of
> calculators
> are allocated and, more importantly, *computed* by
> the filter
> or calculator.
> 
> Since they are computed by the provider class, you
> should not
> attempt to change those object on your own.
> 
> For example, in this particular case, you are taking
> the output
> of a calculator and setting it to identity !!
> 
> This initialization is pointless because it will be
> lost
> as soon as you run the calculator.
> 
> 
> What was your intention with calling SetIdentity()
> here ?
> 
> 
> 
>    Please let us know,
> 
> 
>       Thanks
> 
> 
>         Luis
> 
> 
> 
> -------------
> Lagaffe wrote:
> > Hello,
> > 
> > My old ITK filter (ITK2.0) doesn't compile now
> > (ITK2.2) and I have no idea why ...
> > 
> > many thanks for help
> > arnaud
> > 
> > ...
> > typedef typename
> > itk::Statistics::CovarianceCalculator< SampleType
> >
> > CovarianceAlgorithmType;
> > 	typedef typename CovarianceAlgorithmType::Pointer
> > CovariancePointerType;
> >         CovariancePointerType *covarianceAlgorithm
> =
> > new CovariancePointerType[NumberOfRegions];
> > 
> > 
> > => 
> >
> covarianceAlgorithm[i]->GetOutput()->SetIdentity();
> > 
> > ERROR:
> >  error: passing 'const
> > itk::VariableSizeMatrix<double>' as 'this'
> argument of
> > 'void itk::VariableSizeMatrix<T>::SetIdentity()
> [with
> > T = double]' discards qualifiers
> > 
> > 
> > 
> > 	
> > 
> > 	
> > 		
> >
>
___________________________________________________________________________
> 
> > Appel audio GRATUIT partout dans le monde avec le
> nouveau Yahoo! Messenger 
> > Téléchargez cette version sur
> http://fr.messenger.yahoo.com
> > _______________________________________________
> > Insight-users mailing list
> > Insight-users at itk.org
> > http://www.itk.org/mailman/listinfo/insight-users
> > 
> > 
> 
> 



	

	
		
___________________________________________________________________________ 
Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger 
Téléchargez cette version sur http://fr.messenger.yahoo.com


More information about the Insight-users mailing list