[Insight-developers] Naming Conventions with StatisticsRefactoring
Karthik Krishnan
karthik.krishnan at kitware.com
Sat Apr 11 12:59:38 EDT 2009
I like Brad's suggestion too.
As it is, most statistics filters are new, (they used to exist as
calculators), so while christening them for the first time, might as well
name them right.
A minor improvement on Brad's suggestion follows:
Looking at the existing classes in Code/Numerics/Statistics, I can see the
following names :
ListSampleToHistogramFilter
SampleMeanShiftBlurringFilter
SampleMeanShiftClusteringFilter
SampleSelectiveMeanShiftBlurringFilter
SampleToHistogramProjectionFilter
Perhaps this indicates that the "sample" should be the prefix rather than
the suffix since its taken as the input
Unless someone objects, I'll rename the following classes in the sandbox :
CovarianceFilter -> SampleCovarianceFilter
MeanFilter -> SampleMeanFilter
StandardDeviationPerComponentFilter ->
SampleStandardDeviationPerComponentFilter
WeightedCovarianceFilter -> SampleWeightedCovarianceFilter
WeightedMeanFilter -> SampleWeightedMeanFilter
Thanks
--
karthik
On Sat, Apr 11, 2009 at 12:21 PM, Bill Lorensen <bill.lorensen at gmail.com>wrote:
> I like it.
>
> On Sat, Apr 11, 2009 at 11:45 AM, Bradley Lowekamp
> <blowekamp at mail.nih.gov> wrote:
> > As all image filters in it end with ImageFilter for their name, I think
> > a similar naming convention should be done with the statistics. Consider
> the
> > following
> > $ ls *Filter.h
> > itkCovarianceFilter.h itkSampleToSubsampleFilter.h
> > itkHistogramToTextureFeaturesFilter.h
> > itkScalarImageToCooccurrenceListSampleFilter.h
> > itkImageClassifierFilter.h itkScalarImageToCooccurrenceMatrixFilter.h
> > itkImageToHistogramFilter.h itkScalarImageToTextureFeaturesFilter.h
> > itkImageToListSampleFilter.h itkStandardDeviationPerComponentFilter.h
> > itkMeanFilter.h itkWeightedCovarianceFilter.h
> > itkSampleClassifierFilter.h itkWeightedMeanFilter.h
> > This is just a listing of all the filters. But keeping object type which
> the
> > filters operate on seem like a very important convention to maintain. For
> > example
> > itkMeanFilter.h -> itkMeanSampleFilter
> > itkWeightedCovarianceFilter.h ->
> itkWeightedCovarianceSampleFilter
> > itkWeightedMeanFilter.h -> itkWeightedMeanSampleFilter
> >
> > Some of the conversion type filters are a bit more complicated as to what
> > this qualifier in the name should be. On the other side there is not a
> > common base class, so the naming could be justified as different because
> of
> > this...
> > Brad
> > On Apr 11, 2009, at 11:05 AM, Karthik Krishnan wrote:
> >
> > It seems rather cryptic and related to the following commit in some way.
> >
> > --- Source/itkSubsample.h (revision 4044)
> > +++ Source/itkSubsample.h (working copy)
> > @@ -70,6 +70,9 @@
> >
> > + /** Get the Id Holder */
> > + itkGetConstReferenceMacro(IdHolder, InstanceIdentifierHolder);
> >
> >
> > Thanks
> > --
> > karthik
> >
> >
> > On Sat, Apr 11, 2009 at 11:02 AM, Bill Lorensen <bill.lorensen at gmail.com
> >
> > wrote:
> >>
> >> I'll take a look today.
> >>
> >> On Sat, Apr 11, 2009 at 10:22 AM, Karthik Krishnan
> >> <karthik.krishnan at kitware.com> wrote:
> >> > Hi Bill:
> >> >
> >> > Thanks for looking at this. I am getting a few build errors after
> >> > updating
> >> > with your changes. They are reported on the following experimental
> build
> >> > from my laptop (gcc4.3 linux)
> >> >
> >> > http://www.cdash.org/CDash/viewBuildError.php?buildid=310844
> >> >
> >> > Any idea ? There are cryptic errors from std::operator <<
> >> >
> >> > Thanks
> >> > --
> >> > karthik
> >> >
> >> > On Sat, Apr 11, 2009 at 9:35 AM, Bill Lorensen <
> bill.lorensen at gmail.com>
> >> > wrote:
> >> >>
> >> >> I checked in a fix modeled after itkNumericTraitsRGBPixel.h.
> >> >> Fortunately, since the template is short it's not quite as ugly.
> >> >>
> >> >> Bill
> >> >>
> >> >> On Sat, Apr 11, 2009 at 9:21 AM, Bill Lorensen
> >> >> <bill.lorensen at gmail.com>
> >> >> wrote:
> >> >> > Looks like a similar issued is handled by
> >> >> > Insight/Code/Common/itkNumericTraitsRGBPixel.h with some macros.
> >> >> >
> >> >> > Bill
> >> >> >
> >> >
> >> >
> >> >
> >> > --
> >> > Karthik Krishnan
> >> > R&D Engineer,
> >> > Kitware Inc.
> >> > Ph: 518 881 4919
> >> > Fax: 518 371 4573
> >> >
> >
> >
> >
> > --
> > Karthik Krishnan
> > R&D Engineer,
> > Kitware Inc.
> > Ph: 518 881 4919
> > Fax: 518 371 4573
> > <ATT00001.txt>
> >
>
--
Karthik Krishnan
R&D Engineer,
Kitware Inc.
Ph: 518 881 4919
Fax: 518 371 4573
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20090411/f4bd7ae9/attachment.htm>
More information about the Insight-developers
mailing list