Commit 9b5d6859 authored by Antoine Regimbeau's avatar Antoine Regimbeau
Browse files

BUG : NOT COMPILING! :result of sed modification for Get and set signed spacing

parent bbdada00
......@@ -114,20 +114,20 @@ int main(int, char *[])
// Software Guide : BeginLatex
//
// The array can be assigned to the image using
// the \code{SetSpacing()} method.
// the \code{SetSignedSpacing()} method.
//
// \index{otb::Image!SetSpacing()}
// \index{otb::Image!SetSignedSpacing()}
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
image->SetSpacing(spacing);
image->SetSignedSpacing(spacing);
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// The spacing information can be retrieved from an image by using the
// \code{GetSpacing()} method. This method returns a reference to a
// \code{GetSignedSpacing()} method. This method returns a reference to a
// \code{FixedArray}. The returned object can then be used to read the
// contents of the array. Note the use of the \code{const} keyword to indicate
// that the array will not be modified.
......@@ -135,7 +135,7 @@ int main(int, char *[])
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
const ImageType::SpacingType& sp = image->GetSpacing();
const ImageType::SpacingType& sp = image->GetSignedSpacing();
std::cout << "Spacing = ";
std::cout << sp[0] << ", " << sp[1] << std::endl;
......
......@@ -99,7 +99,7 @@ int main(int argc, char * argv[])
ImagePointType origin = image->GetOrigin();
ImageType::SpacingType spacing = image->GetSpacing();
ImageType::SpacingType spacing = image->GetSignedSpacing();
ImageType::SizeType size = image->GetBufferedRegion().GetSize();
ImagePointType point;
......
......@@ -374,7 +374,7 @@ int main(int argc, char* argv[])
// Software Guide : BeginCodeSnippet
generator->SetOutputOrigin(fixedReader->GetOutput()->GetOrigin());
generator->SetOutputSpacing(fixedReader->GetOutput()->GetSpacing());
generator->SetOutputSpacing(fixedReader->GetOutput()->GetSignedSpacing());
generator->SetOutputSize(fixedReader->GetOutput()
->GetLargestPossibleRegion().GetSize());
// Software Guide : EndCodeSnippet
......@@ -439,7 +439,7 @@ int main(int argc, char* argv[])
warper->SetInput(movingReader->GetOutput());
warper->SetDisplacementField(generator->GetOutput());
warper->SetOutputOrigin(fixedReader->GetOutput()->GetOrigin());
warper->SetOutputSpacing(fixedReader->GetOutput()->GetSpacing());
warper->SetOutputSpacing(fixedReader->GetOutput()->GetSignedSpacing());
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
......
......@@ -179,7 +179,7 @@ int main(int argc, char * argv[])
vectorDataRenderer->SetSize(reader->GetOutput()->GetLargestPossibleRegion().GetSize());
vectorDataRenderer->SetOrigin(reader->GetOutput()->GetOrigin());
vectorDataRenderer->SetSpacing(reader->GetOutput()->GetSpacing());
vectorDataRenderer->SetSpacing(reader->GetOutput()->GetSignedSpacing());
vectorDataRenderer->SetRenderingStyleType(VectorDataRendererType::Binary);
blendingFilter->SetInput1(reader->GetOutput());
......
......@@ -237,7 +237,7 @@ int main(int argc, char * argv[])
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
ImageType::SpacingType spacing = reader->GetOutput()->GetSpacing();
ImageType::SpacingType spacing = reader->GetOutput()->GetSignedSpacing();
ImageType::PointType origin = reader->GetOutput()->GetOrigin();
//OutputImageType::SizeType size = outputImage->GetLargestPossibleRegion().GetSize();
......
......@@ -116,7 +116,7 @@ int main(int itkNotUsed(argc), char* argv[])
// SoftwareGuide: EndLatex
// SoftwareGuide : BeginCodeSnippet
file << "Spacing " << image->GetSpacing() << std::endl;
file << "Spacing " << image->GetSignedSpacing() << std::endl;
file << "Origin " << image->GetOrigin() << std::endl;
file << "Projection REF " << image->GetProjectionRef() << std::endl;
......
......@@ -104,7 +104,7 @@ int main(int argc, char *argv[])
Index4DType index4D = region4D.GetIndex();
Size4DType size4D = region4D.GetSize();
Spacing4DType spacing4D = image4D->GetSpacing();
Spacing4DType spacing4D = image4D->GetSignedSpacing();
Origin4DType origin4D = image4D->GetOrigin();
for (unsigned int i = 0; i < 3; ++i)
......@@ -115,7 +115,7 @@ int main(int argc, char *argv[])
origin3D[i] = origin4D[i];
}
image3D->SetSpacing(spacing3D);
image3D->SetSignedSpacing(spacing3D);
image3D->SetOrigin(origin3D);
Region3DType region3D;
......
......@@ -170,7 +170,7 @@ int main(int argc, char *argv[])
// Software Guide : BeginCodeSnippet
ImageType::Pointer outputImage = ImageType::New();
outputImage->SetRegions(outputRegion);
const ImageType::SpacingType& spacing = reader->GetOutput()->GetSpacing();
const ImageType::SpacingType& spacing = reader->GetOutput()->GetSignedSpacing();
const ImageType::PointType& inputOrigin = reader->GetOutput()->GetOrigin();
double outputOrigin[Dimension];
......@@ -179,7 +179,7 @@ int main(int argc, char *argv[])
outputOrigin[i] = inputOrigin[i] + spacing[i] * inputStart[i];
}
outputImage->SetSpacing(spacing);
outputImage->SetSignedSpacing(spacing);
outputImage->SetOrigin(outputOrigin);
outputImage->Allocate();
// Software Guide : EndCodeSnippet
......
......@@ -321,7 +321,7 @@ int main(int argc, char* argv[])
resampler->SetTransform(estimator->GetAffineTransform());
resampler->SetSize(fixedImage->GetLargestPossibleRegion().GetSize());
resampler->SetOutputOrigin(fixedImage->GetOrigin());
resampler->SetOutputSpacing(fixedImage->GetSpacing());
resampler->SetOutputSpacing(fixedImage->GetSignedSpacing());
resampler->SetDefaultPixelValue(100);
// Software Guide : EndCodeSnippet
......
......@@ -304,7 +304,7 @@ int main(int argc, char* argv[])
// Software Guide : BeginCodeSnippet
ImageType::ConstPointer fixedImage = fixedReader->GetOutput();
deformer->SetOutputSpacing(fixedImage->GetSpacing());
deformer->SetOutputSpacing(fixedImage->GetSignedSpacing());
deformer->SetOutputOrigin(fixedImage->GetOrigin());
deformer->SetOutputRegion(fixedImage->GetLargestPossibleRegion());
// Software Guide : EndCodeSnippet
......
......@@ -234,7 +234,7 @@ int main(int argc, char * argv[])
}
PointsIteratorType pIt = filter->GetOutput()->GetPoints()->Begin();
ImageType::SpacingType spacing = reader->GetOutput()->GetSpacing();
ImageType::SpacingType spacing = reader->GetOutput()->GetSignedSpacing();
ImageType::PointType origin = reader->GetOutput()->GetOrigin();
OutputImageType::SizeType size =
outputImage->GetLargestPossibleRegion().GetSize();
......
......@@ -239,7 +239,7 @@ int main(int argc, char * argv[])
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
ImageType::SpacingType spacing = reader->GetOutput()->GetSpacing();
ImageType::SpacingType spacing = reader->GetOutput()->GetSignedSpacing();
ImageType::PointType origin = reader->GetOutput()->GetOrigin();
// Software Guide : EndCodeSnippet
......
......@@ -129,7 +129,7 @@ int main(int argc, char* argv[])
// necessary for sensors
filter->SetOutputOrigin(imageReader->GetOutput()->GetOrigin());
// necessary for sensors
filter->SetOutputSpacing(imageReader->GetOutput()->GetSpacing());
filter->SetOutputSpacing(imageReader->GetOutput()->GetSignedSpacing());
// ~ wkt
filter->SetOutputProjectionRef( imageReader->GetOutput()->GetProjectionRef());
// Software Guide : EndCodeSnippet
......
......@@ -93,7 +93,7 @@ int main(int argc, char* argv[])
reader->GenerateOutputInformation();
std::cout << "Original input imagine spacing: " <<
reader->GetOutput()->GetSpacing() << std::endl;
reader->GetOutput()->GetSignedSpacing() << std::endl;
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
......@@ -197,7 +197,7 @@ int main(int argc, char* argv[])
outputImage->SetOrigin(origin);
outputImage->SetRegions(region);
outputImage->SetSpacing(spacing);
outputImage->SetSignedSpacing(spacing);
outputImage->Allocate();
// Software Guide : EndCodeSnippet
......
......@@ -105,13 +105,13 @@ int main(int argc, char* argv[])
TypedRegion::IndexType index;
size[0] = imageReader->GetOutput()->GetLargestPossibleRegion().GetSize()[0]
* imageReader->GetOutput()->GetSpacing()[0];
* imageReader->GetOutput()->GetSignedSpacing()[0];
size[1] = imageReader->GetOutput()->GetLargestPossibleRegion().GetSize()[1]
* imageReader->GetOutput()->GetSpacing()[1];
* imageReader->GetOutput()->GetSignedSpacing()[1];
index[0] = imageReader->GetOutput()->GetOrigin()[0]
- 0.5 * imageReader->GetOutput()->GetSpacing()[0];
- 0.5 * imageReader->GetOutput()->GetSignedSpacing()[0];
index[1] = imageReader->GetOutput()->GetOrigin()[1]
- 0.5 * imageReader->GetOutput()->GetSpacing()[1];
- 0.5 * imageReader->GetOutput()->GetSignedSpacing()[1];
region.SetSize(size);
region.SetOrigin(index);
......
......@@ -143,7 +143,7 @@ int main(int argc, char* argv[])
vectorDataProjection->SetOutputOrigin(
imageReader->GetOutput()->GetOrigin());
vectorDataProjection->SetOutputSpacing(
imageReader->GetOutput()->GetSpacing());
imageReader->GetOutput()->GetSignedSpacing());
vectorDataProjection->SetOutputProjectionRef(
imageReader->GetOutput()->GetProjectionRef());
// Software Guide : EndCodeSnippet
......
......@@ -596,7 +596,7 @@ int main(int argc, char *argv[])
FixedImageType::Pointer fixedImage = fixedImageReader->GetOutput();
resampler->SetSize(fixedImage->GetLargestPossibleRegion().GetSize());
resampler->SetOutputOrigin(fixedImage->GetOrigin());
resampler->SetOutputSpacing(fixedImage->GetSpacing());
resampler->SetOutputSpacing(fixedImage->GetSignedSpacing());
resampler->SetDefaultPixelValue(100);
// Software Guide : EndCodeSnippet
......
......@@ -481,7 +481,7 @@ int main(int argc, char *argv[])
resample->SetSize(fixedImage->GetLargestPossibleRegion().GetSize());
resample->SetOutputOrigin(fixedImage->GetOrigin());
resample->SetOutputSpacing(fixedImage->GetSpacing());
resample->SetOutputSpacing(fixedImage->GetSignedSpacing());
resample->SetDefaultPixelValue(100);
typedef unsigned char OutputPixelType;
......
......@@ -277,7 +277,7 @@ int main(int argc, char *argv[])
// Software Guide : BeginCodeSnippet
FixedImageType::Pointer fixedImage = fixedImageReader->GetOutput();
const SpacingType fixedSpacing = fixedImage->GetSpacing();
const SpacingType fixedSpacing = fixedImage->GetSignedSpacing();
const OriginType fixedOrigin = fixedImage->GetOrigin();
const RegionType fixedRegion = fixedImage->GetLargestPossibleRegion();
const SizeType fixedSize = fixedRegion.GetSize();
......@@ -297,7 +297,7 @@ int main(int argc, char *argv[])
// Software Guide : BeginCodeSnippet
MovingImageType::Pointer movingImage = movingImageReader->GetOutput();
const SpacingType movingSpacing = movingImage->GetSpacing();
const SpacingType movingSpacing = movingImage->GetSignedSpacing();
const OriginType movingOrigin = movingImage->GetOrigin();
const RegionType movingRegion = movingImage->GetLargestPossibleRegion();
const SizeType movingSize = movingRegion.GetSize();
......@@ -528,7 +528,7 @@ int main(int argc, char *argv[])
resample->SetSize(fixedImage->GetLargestPossibleRegion().GetSize());
resample->SetOutputOrigin(fixedImage->GetOrigin());
resample->SetOutputSpacing(fixedImage->GetSpacing());
resample->SetOutputSpacing(fixedImage->GetSignedSpacing());
resample->SetDefaultPixelValue(100);
typedef otb::ImageFileWriter<FixedImageType> WriterFixedType;
......
......@@ -544,7 +544,7 @@ int main(int argc, char *argv[])
resampler->SetSize(fixedImage->GetLargestPossibleRegion().GetSize());
resampler->SetOutputOrigin(fixedImage->GetOrigin());
resampler->SetOutputSpacing(fixedImage->GetSpacing());
resampler->SetOutputSpacing(fixedImage->GetSignedSpacing());
resampler->SetDefaultPixelValue(100);
typedef unsigned char OutputPixelType;
......
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