[Insight-developers] Naming Conventions with StatisticsRefactoring

Bradley Lowekamp blowekamp at mail.nih.gov
Sat Apr 11 13:32:15 EDT 2009


That looks right. But I have not looked through all the filters....  
What about the Classifiers?

itkImageClassifierFilter -> itkClassifierImageFilter
itkSampleClassifierFilter -> itkClassifierSampleFilter

?


On Apr 11, 2009, at 1:24 PM, Bill Lorensen wrote:

> looks good to me. Brad?
>
> On Sat, Apr 11, 2009 at 1:22 PM, Karthik Krishnan
> <karthik.krishnan at kitware.com> wrote:
>> Thanks. Its the following then
>>
>>             CovarianceFilter -> CovarianceSampleFilter
>>             MeanFilter -> MeanSampleFilter
>>             StandardDeviationPerComponentF
>> ilter -> StandardDeviationPerSampleComponentFilter
>>             WeightedCovarianceFilter ->  
>> WeightedCovarianceSampleFilter
>>             WeightedMeanFilter -> WeightedMeanSampleFilter
>> Is this fine ?
>>
>>
>> On Sat, Apr 11, 2009 at 1:10 PM, Bill Lorensen <bill.lorensen at gmail.com 
>> >
>> wrote:
>>>
>>> Hmmm..
>>> the Mean filter is filtering samples so it should be  
>>> MeanSampleFilter
>>> just like itkMeanImageFilter (not ImageMeanFilter).
>>>
>>> On Sat, Apr 11, 2009 at 12:59 PM, Karthik Krishnan
>>> <karthik.krishnan at kitware.com> wrote:
>>>> 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
>>>>>>>>>>
>>>>>>>>


More information about the Insight-developers mailing list