Skip to content

Commit 948e075

Browse files
N-Dekkerdzenanz
authored andcommitted
STYLE: Remove local origin and spacing variables from PyBuffer
The default-constructor of `itk::ImageBase` already zero-fills the origin, and already fills the spacing by 1.
1 parent 09ad02d commit 948e075

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

Modules/Bridge/NumPy/include/itkPyBuffer.hxx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,6 @@ PyBuffer<TImage>::_GetImageViewFromArray(PyObject * arr, PyObject * shape, PyObj
111111
std::reverse(size.begin(), size.end());
112112
}
113113

114-
PointType origin;
115-
origin.Fill(0.0);
116-
117-
SpacingType spacing;
118-
spacing.Fill(1.0);
119-
120114
using InternalPixelType = typename TImage::InternalPixelType;
121115
using ImporterType = ImportImageContainer<SizeValueType, InternalPixelType>;
122116
auto importer = ImporterType::New();
@@ -126,8 +120,6 @@ PyBuffer<TImage>::_GetImageViewFromArray(PyObject * arr, PyObject * shape, PyObj
126120

127121
OutputImagePointer output = TImage::New();
128122
output->SetRegions(size);
129-
output->SetOrigin(origin);
130-
output->SetSpacing(spacing);
131123
output->SetPixelContainer(importer);
132124
output->SetNumberOfComponentsPerPixel(numberOfComponents);
133125

0 commit comments

Comments
 (0)