[Insight-developers] HistogramToImageFilter bugs

Luis Ibanez luis.ibanez at kitware.com
Thu Jan 18 08:54:14 EST 2007


Hi Gaetan,

The correct solution is to have two extra boolean flags
indicating whether the user has actually invoked the
SetOrigin or SetSpacing methods and provided values of
her/his own.

When the flags are on, then we use the values provided
by the user. When the flags are off, then we compute
the values based on the settings of the histogram.

Look for example at the FastMarchingImageFilter and
the option "OverrideOutputInformation".

Please let us know if you find difficulties implementing
this approach.



As Bill pointed out, no methods should be removed from
the API of ITK classes. The extreme case of a deprecation
process requires the methods in question to be marked as
deprecated and to appear in that condition for two releases.

Keep in mind that ITK is being used by manufacturers of
medical devices. Using a two-release deprecation warning
is a safe mechanism for facilitating migration of
applications when API changes are the only option.

Note that our commitment to backward compatibility is
also one of the reasons why new classes are only committed
to the Code/Review directory. We want to make sure that
any significant API changes happen while classes are in
this directory, before they move to their final destination
in the toolkit.  Once classes move out of the Code/Review
directory we are committed to maintain their API unchanged.



    Thanks


      Luis



------------------------------------------
Lorensen, William E (GE, Research) wrote:
> Yes. If you remove them, somebody, somewhere in the world will get a compilaton error. You can certainly print an informative message if they use these methods. But, we cannot tolerate changes that cause compiler errors.
> 
> Bill  
> 
> -----Original Message-----
> From: Gaëtan Lehmann [mailto:gaetan.lehmann at jouy.inra.fr] 
> Sent: Wednesday, January 17, 2007 2:39 PM
> To: Lorensen, William E (GE, Research); Luis Ibanez; Karthik Krishnan
> Cc: insight-developers at itk.org
> Subject: Re: [Insight-developers] HistogramToImageFilter bugs
> 
> Le Wed, 17 Jan 2007 20:27:18 +0100, Lorensen, William E (GE, Research) <lorensen at crd.ge.com> a écrit:
> 
> 
>>Choice (a) violates our backward comptibility policy.
>>
> 
> 
> even if those methods have no effect ?
> 
> 
>>-----Original Message-----
>>From: insight-developers-bounces+lorensen=crd.ge.com at itk.org
>>[mailto:insight-developers-bounces+lorensen=crd.ge.com at itk.org] On 
>>Behalf Of Gaetan Lehmann
>>Sent: Wednesday, January 17, 2007 11:10 AM
>>To: Luis Ibanez; Karthik Krishnan
>>Cc: insight-developers at itk.org
>>Subject: [Insight-developers] HistogramToImageFilter bugs
>>
>>
>>Luis, Karthik,
>>
>>I have just fixed a small bug in HistogramToImageFilter, but while 
>>doing that, I noticed that the origin and spacing provided by the user 
>>are always overiden by the filter:
>>
>>http://www.itk.org/cgi-bin/cvsweb.cgi/Code/Numerics/Statistics/itkHist
>>ogramToImageFilter.txx?root=Insight&r1=1.3&r2=1.4
>>
>>2 choices:
>>(a) remove the SetOrigin() and SetSpacing() methods, because they are 
>>useless
>>(b) use the values provided by the user instead of computing new ones
>>
>>I think that (b) is the best option, but as I don't understand why 
>>those values are modified in GenerateData(), I'm not completly sure 
>>:-)
>>
>>Gaetan
>>
>>--
>>Gaëtan Lehmann
>>Biologie du Développement et de la Reproduction INRA de Jouy-en-Josas
>>(France)
>>tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
>>http://voxel.jouy.inra.fr
>>_______________________________________________
>>Insight-developers mailing list
>>Insight-developers at itk.org
>>http://www.itk.org/mailman/listinfo/insight-developers
> 
> 
> 
> 
> --
> Gaëtan Lehmann
> Biologie du Développement et de la Reproduction INRA de Jouy-en-Josas (France)
> tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
> http://voxel.jouy.inra.fr
> _______________________________________________
> Insight-developers mailing list
> Insight-developers at itk.org
> http://www.itk.org/mailman/listinfo/insight-developers
> 


More information about the Insight-developers mailing list