MCPcopy Create free account
hub / github.com/MITK/MITK / FixupSpacing

Method FixupSpacing

Modules/DICOM/src/mitkDICOMImageBlockDescriptor.cpp:189–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

187}
188
189mitk::Image::Pointer mitk::DICOMImageBlockDescriptor::FixupSpacing( Image* mitkImage )
190{
191 if ( mitkImage )
192 {
193 Vector3D imageSpacing = mitkImage->GetGeometry()->GetSpacing();
194
195 ScalarType desiredSpacingX = imageSpacing[0];
196 ScalarType desiredSpacingY = imageSpacing[1];
197 this->GetDesiredMITKImagePixelSpacing(
198 desiredSpacingX, desiredSpacingY ); // prefer pixel spacing over imager pixel spacing
199
200 if ( desiredSpacingX <= 0 || desiredSpacingY <= 0 )
201 {
202 return mitkImage;
203 }
204
205 MITK_DEBUG << "Loaded image with spacing " << imageSpacing[0] << ", " << imageSpacing[1];
206 MITK_DEBUG << "Found correct spacing info " << desiredSpacingX << ", " << desiredSpacingY;
207
208 imageSpacing[0] = desiredSpacingX;
209 imageSpacing[1] = desiredSpacingY;
210 mitkImage->GetGeometry()->SetSpacing( imageSpacing );
211 }
212
213 return mitkImage;
214}
215void mitk::DICOMImageBlockDescriptor::SetSliceIsLoaded( unsigned int index, bool isLoaded )
216{
217 if ( index < m_SliceIsLoaded.size() )

Callers 1

SetMitkImageMethod · 0.95

Calls 4

GetGeometryMethod · 0.80
GetSpacingMethod · 0.45
SetSpacingMethod · 0.45

Tested by

no test coverage detected