Commit 5b958034 authored by Lozac'h Loic's avatar Lozac'h Loic
Browse files

FIX: issue with SignedSpacing

parent cbd1c1a9
No related merge requests found
Showing with 9 additions and 9 deletions
+9 -9
...@@ -201,7 +201,7 @@ CacheLessLabelImageToVectorData<TInputImagePixel> ...@@ -201,7 +201,7 @@ CacheLessLabelImageToVectorData<TInputImagePixel>
bufferedInputImage->SetRegions(inputRegion); bufferedInputImage->SetRegions(inputRegion);
bufferedInputImage->Allocate(); bufferedInputImage->Allocate();
bufferedInputImage->SetMetaDataDictionary(inputPtr->GetMetaDataDictionary()); bufferedInputImage->SetMetaDataDictionary(inputPtr->GetMetaDataDictionary());
bufferedInputImage->SetSpacing(inputPtr->GetSignedSpacing()); bufferedInputImage->SetSignedSpacing(inputPtr->GetSignedSpacing());
bufferedInputImage->SetOrigin (inputPtr->GetOrigin() ); bufferedInputImage->SetOrigin (inputPtr->GetOrigin() );
......
...@@ -43,15 +43,15 @@ MeanResampleImageFilter<TImage> ...@@ -43,15 +43,15 @@ MeanResampleImageFilter<TImage>
// The new output image has the same origin // The new output image has the same origin
ImagePointType origin = inputImage->GetOrigin(); ImagePointType origin = inputImage->GetOrigin();
origin[0] += 0.5 * inputImage->GetSignedSpacing()[0] * (m_StepX - 1); origin[0] += 0.5 * inputImage->GetSpacing()[0] * (m_StepX - 1);
origin[1] += 0.5 * inputImage->GetSignedSpacing()[1] * (m_StepY - 1); origin[1] += 0.5 * inputImage->GetSpacing()[1] * (m_StepY - 1);
outputPtr->SetOrigin ( origin ); outputPtr->SetOrigin ( origin );
// New spacing for the output image // New spacing for the output image
ImageSpacingType spacing = inputImage->GetSignedSpacing(); ImageSpacingType spacing = inputImage->GetSpacing();
spacing[0] *= m_StepX; spacing[0] *= m_StepX;
spacing[1] *= m_StepY; spacing[1] *= m_StepY;
outputPtr->SetSignedSpacing (spacing); outputPtr->SetSpacing (spacing);
// New size for the output image // New size for the output image
ImageRegionType inRegion = inputImage->GetLargestPossibleRegion(); ImageRegionType inRegion = inputImage->GetLargestPossibleRegion();
......
...@@ -119,7 +119,7 @@ VectorDataToLabelImageCustomFilter<TVectorData, TOutputImage> ...@@ -119,7 +119,7 @@ VectorDataToLabelImageCustomFilter<TVectorData, TOutputImage>
::SetOutputParametersFromImage(const ImageBaseType * src) ::SetOutputParametersFromImage(const ImageBaseType * src)
{ {
this->SetOutputOrigin ( src->GetOrigin() ); this->SetOutputOrigin ( src->GetOrigin() );
this->SetOutputSignedSpacing ( src->GetSignedSpacing() ); this->SetOutputSpacing ( src->GetSignedSpacing() );
this->SetOutputSize ( src->GetLargestPossibleRegion().GetSize() ); this->SetOutputSize ( src->GetLargestPossibleRegion().GetSize() );
otb::ImageMetadataInterfaceBase::Pointer imi = otb::ImageMetadataInterfaceFactory::CreateIMI(src->GetMetaDataDictionary()); otb::ImageMetadataInterfaceBase::Pointer imi = otb::ImageMetadataInterfaceFactory::CreateIMI(src->GetMetaDataDictionary());
this->SetOutputProjectionRef(imi->GetProjectionRef()); this->SetOutputProjectionRef(imi->GetProjectionRef());
...@@ -144,7 +144,7 @@ VectorDataToLabelImageCustomFilter<TVectorData, TOutputImage> ...@@ -144,7 +144,7 @@ VectorDataToLabelImageCustomFilter<TVectorData, TOutputImage>
outputPtr->SetLargestPossibleRegion(outputLargestPossibleRegion); outputPtr->SetLargestPossibleRegion(outputLargestPossibleRegion);
// Set spacing and origin // Set spacing and origin
outputPtr->SetSignedSpacing(m_OutputSpacing); outputPtr->SetSpacing(m_OutputSpacing);
outputPtr->SetOrigin(m_OutputOrigin); outputPtr->SetOrigin(m_OutputOrigin);
itk::MetaDataDictionary& dict = outputPtr->GetMetaDataDictionary(); itk::MetaDataDictionary& dict = outputPtr->GetMetaDataDictionary();
...@@ -295,8 +295,8 @@ VectorDataToLabelImageCustomFilter<TVectorData, TOutputImage>::GenerateData() ...@@ -295,8 +295,8 @@ VectorDataToLabelImageCustomFilter<TVectorData, TOutputImage>::GenerateData()
this->GetOutput()->TransformIndexToPhysicalPoint(bufferIndexOrigin, bufferOrigin); this->GetOutput()->TransformIndexToPhysicalPoint(bufferIndexOrigin, bufferOrigin);
geoTransform[0] = bufferOrigin[0]; geoTransform[0] = bufferOrigin[0];
geoTransform[3] = bufferOrigin[1]; geoTransform[3] = bufferOrigin[1];
geoTransform[1] = this->GetOutput()->GetSignedSpacing()[0]; geoTransform[1] = this->GetOutput()->GetSpacing()[0];
geoTransform[5] = this->GetOutput()->GetSignedSpacing()[1]; geoTransform[5] = this->GetOutput()->GetSpacing()[1];
// FIXME: Here component 1 and 4 should be replaced by the orientation parameters // FIXME: Here component 1 and 4 should be replaced by the orientation parameters
geoTransform[2] = 0.; geoTransform[2] = 0.;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment