[Insight-users] How to return user defined datatype & how to access an array which is returned by a function ?

Ritesh Bafna riteshramesh-bafna at uiowa.edu
Thu Mar 2 15:45:19 EST 2006


Hi,
 
This is my main program which calls Update ( ) method on
RebinHexahedronMeshTraitDataInPlaceFilter
 
typedef itk::RebinHexahedronMeshTraitDataInPlaceFilter<MeshType, MeshType>
RebinHexahedronMeshTraitDataInPlaceFilterType;
RebinHexahedronMeshTraitDataInPlaceFilterType::Pointer
rebinHexahedronMeshTraitDataInPlaceFilter =
RebinHexahedronMeshTraitDataInPlaceFilterType::New();
rebinHexahedronMeshTraitDataInPlaceFilter->rebinHexahedronMeshTraitDataInPla
ceFilter->SetInput(tmpMesh);
rebinHexahedronMeshTraitDataInPlaceFilter->SetNumberOfHistogramBins(NumberOf
Bins);
rebinHexahedronMeshTraitDataInPlaceFilter->Update();
MeshType::Pointer finalMesh =
rebinHexahedronMeshTraitDataInPlaceFilter->GetOutput();
 

This is the GenerateData ( ) Method in
RebinHexahedronMeshTraitDataInPlaceFilter
 
template <class TInputMesh, class TOutputMesh>
return type
RebinHexahedronMeshTraitDataInPlaceFilter<TInputMesh, TOutputMesh>
::GenerateData()
 
{
 ....
 ....
 ArrayType binValue;
 binValue.SetSize( m_NumberOfHistogramBins )
 ....
 ....
 ....
 
 return binValue;
}
 
Question 1) how do I specify the return type of Generate Data so that it
returns binValue ( of type ItkArray) ?
Question 2) how do I access the array which is returned by GenerateData( )
in my main program (code snippet) ?
 
Thanks in advance
 
Ritesh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20060302/860b5186/attachment.html


More information about the Insight-users mailing list