21 : m_Subset(0), m_CameraIntrinsics(), m_InterPixelDistance()
27 m_CameraIntrinsics->SetDistorsionCoeffs(-0.36874385358645773f,-0.14339503290129013,0.0033210108720361795,-0.004277703352074105);
42 if ((distanceImage ==
nullptr) && (idx == this->GetNumberOfInputs() - 1))
44 this->SetNumberOfIndexedInputs(this->GetNumberOfInputs() - 1);
48 this->ProcessObject::SetNthInput(idx, const_cast<mitk::Image*>(distanceImage));
60 if (this->GetNumberOfInputs() < 1)
63 return static_cast< mitk::Image*
>(this->ProcessObject::GetInput(idx));
71 unsigned int xDim = UINT_MAX;
72 unsigned int yDim = UINT_MAX;
74 if(input.IsNotNull() && input->IsInitialized())
76 xDim = input->GetDimension(0);
77 yDim = input->GetDimension(1);
80 bool pointSetValid =
true;
81 for (
unsigned int i=0; i<subset.size(); i++)
84 if (currentIndex[0] < 0 || currentIndex[0] > static_cast<itk::IndexValueType>(xDim) ||
85 currentIndex[1] < 0 || currentIndex[1] > static_cast<itk::IndexValueType>(yDim))
87 pointSetValid =
false;
96 MITK_ERROR<<
"One or more indizes are located outside the image domain";
102 std::vector<itk::Index<3> > subset;
103 for (
int i=0; i<pointSet->GetSize(); i++)
107 currentIndex[0] = currentPoint[0];
108 currentIndex[1] = currentPoint[1];
109 currentIndex[2] = currentPoint[2];
110 subset.push_back(currentIndex);
124 focalLengthInMm = 0.0;
128 focalLengthInPixelUnits[0] = 0.0;
129 focalLengthInPixelUnits[1] = 0.0;
146 for (
unsigned int i=0; i<
m_Subset.size(); i++)
150 index2D[0] = currentIndex[0];
151 index2D[1] = currentIndex[1];
160 output->InsertPoint(i,currentPoint);
165 int xDimension = (int)input->GetDimension(0);
166 int yDimension = (int)input->GetDimension(1);
169 for (
int j=0; j<yDimension; j++)
171 for (
int i=0; i<xDimension; i++)
187 output->InsertPoint( pointCount, currentPoint );
197 this->SetNumberOfIndexedOutputs(this->GetNumberOfInputs());
198 for (
unsigned int idx = 0; idx < this->GetNumberOfIndexedOutputs(); ++idx)
201 DataObjectPointer newOutput = this->
MakeOutput(idx);
202 this->SetNthOutput(idx, newOutput);
210 itkDebugMacro(<<
"GenerateOutputInformation()");
Gives locked and index-based read access for a particular image part. The class provides several set-...
itk::DataObject::Pointer MakeOutput(DataObjectPointerArraySizeType idx) override
static ToFPoint3D IndexToCartesianCoordinatesWithInterpixdist(unsigned int i, unsigned int j, ToFScalarType distance, ToFScalarType focalLength, ToFScalarType interPixelDistanceX, ToFScalarType interPixelDistanceY, ToFScalarType principalPointX, ToFScalarType principalPointY)
Convert index based distances to cartesian coordinates.
bool m_ReconstructionMode
true = Reconstruction without interpixeldistance and with focal lengths in pixel units. false = Reconstruction with interpixeldistance and with focal length in mm.
std::vector< itk::Index< 3 > > m_Subset
If this subset is specified only the contained indizes are converted to cartesian coordinates...
Image * GetInput()
Returns the input of this filter.
void GenerateOutputInformation() override
virtual void SetInput(const Image *distanceImage)
Sets the input of this filter.
bool GetReconstructionMode()
Returns the reconstruction mode.
ToFDistanceImageToPointSetFilter()
Standard constructor.
void CreateOutputsForAllInputs()
Create an output for each input.
void SetReconstructionMode(bool withoutInterpixdist=true)
Sets the reconstruction mode, if using no interpixeldistances and focal lenghts in pixel units (=true...
itk::Point< ToFScalarType, 2 > ToFPoint2D
Image class for storing images.
ToFProcessingCommon::ToFPoint2D m_InterPixelDistance
distance in mm between two adjacent pixels on the ToF camera chip
void GenerateData() override
Method generating the output of this filter. Called in the updated process of the pipeline...
MITKCORE_EXPORT const ScalarType eps
mitk::CameraIntrinsics::Pointer m_CameraIntrinsics
Member holding the intrinsic parameters needed for PointSet calculation.
void SetSubset(std::vector< itk::Index< 3 > > subset)
If this subset is defined, the cartesian coordinates are only computed for the contained indizes...
~ToFDistanceImageToPointSetFilter() override
Standard destructor.
static ToFPoint3D IndexToCartesianCoordinates(unsigned int i, unsigned int j, ToFScalarType distance, ToFScalarType focalLengthX, ToFScalarType focalLengthY, ToFScalarType principalPointX, ToFScalarType principalPointY)
Convert index based distances to cartesian coordinates.