[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 14:21:10 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->rebinHexahedronMeshTraitDataInPlaceFilter->SetInput(tmpMesh);
rebinHexahedronMeshTraitDataInPlaceFilter->SetNumberOfHistogramBins(NumberOfBins);
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



More information about the Insight-users mailing list