[Insight-users] Histogram Example ItkSoftwareGuide

robert tamburo robert.tamburo at gmail.com
Fri Apr 15 17:24:07 EDT 2011


mv is of type MeasurementVectorType which is defined in HistogramType
(i.e., HistogramType::MeasurementVectorType mv). Squish the typedef
assignments together and you get:

itk::Statistics::Histogram< MeasurementType, 2 >::MeasurementVectorType mv ;

where MeasurementVectorType is a FixedArray as defined in Histogram's
superclass Sample.

It's a C(onfusion)++ party!

On Fri, Apr 15, 2011 at 4:53 PM, Hernan Ledesma <fledesma at inti.gob.ar>wrote:

> robert tamburo escribió:
>
>  MeasurementVectorType is defined in the Histogram class as:
>> typedef typename Superclass::MeasurementVectorType
>> MeasurementVectorType;
>>
>> The superclass is Sample:
>> typedef Sample< FixedArray< TMeasurement, VMeasurementVectorSize > >
>> Superclass;
>>
>>
> Thank you very much Robert,
>
> but I think that /histogram/ is an independent object than /mv/; both are
> different instance of a class:
>
> /histogram:/
> typedef itk::Statistics::Histogram< MeasurementType, 2 > HistogramType ;
> HistogramType::Pointer histogram = HistogramType::New() ;
>
> /mv:/
> HistogramType::MeasurementVectorType mv ;
>
>
> Are there some advanced C++ concept that I´m ignoring?
> Is it relate with the concept of SmartPointer?
>
> thank you!
>
>>
>> On Fri, Apr 15, 2011 at 3:48 PM, Hernan Ledesma <fledesma at inti.gob.ar<mailto:
>> fledesma at inti.gob.ar>> wrote:
>>
>>    Hi all,
>>
>>    in chapter 10 of http://www.itk.org/ItkSoftwareGuide.pdf, page 615
>>
>>    Does anybody know how "mv" data is associated with "histogram" object?
>>
>>    is through "index" objetc?
>>
>>    here is the code:
>>
>>    ...
>>    HistogramType::MeasurementVectorType mv ;
>>    mv[0] = 4.1 ;
>>    mv[1] = 5.6 ;
>>    index.Fill(1) ;
>>
>>    // We retrieve the measurement vector at the index value (1, 1),
>>    the center bin’s measurement
>>    // vector. The output is [4.1, 5.6].
>>
>>    std::cout << "Measurement vector at the center bin is "
>>    << histogram->GetMeasurementVector(index) << std::endl ;
>>    ...
>>
>>    Thanks!
>>    _____________________________________
>>    Powered by www.kitware.com <http://www.kitware.com>
>>
>>
>>    Visit other Kitware open-source projects at
>>    http://www.kitware.com/opensource/opensource.html
>>
>>    Kitware offers ITK Training Courses, for more information visit:
>>    http://www.kitware.com/products/protraining.html
>>
>>    Please keep messages on-topic and check the ITK FAQ at:
>>    http://www.itk.org/Wiki/ITK_FAQ
>>
>>    Follow this link to subscribe/unsubscribe:
>>    http://www.itk.org/mailman/listinfo/insight-users
>>
>>
>>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110415/23a3120d/attachment.htm>


More information about the Insight-users mailing list