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

Method DumpImageInformation

Modules/DICOMTesting/src/mitkTestDICOMLoading.cpp:196–305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194}
195
196std::string
197mitk::TestDICOMLoading::DumpImageInformation( const Image* image )
198{
199 std::stringstream result;
200
201 if (image == nullptr) return result.str();
202
203 SetDefaultLocale();
204
205 // basic image data
206 DumpLine( "Pixeltype", ComponentTypeToString(image->GetPixelType().GetComponentType()) );
207 DumpLine( "BitsPerPixel", image->GetPixelType().GetBpe() );
208 DumpLine( "Dimension", image->GetDimension() );
209
210 result << "Dimensions: ";
211 for (unsigned int dim = 0; dim < image->GetDimension(); ++dim)
212 result << image->GetDimension(dim) << " ";
213 result << "\n";
214
215 // geometry data
216 result << "Geometry: \n";
217 const TimeGeometry* timeGeometry = image->GetTimeGeometry();
218 BaseGeometry* geometry = timeGeometry->GetGeometryForTimeStep(0);
219 if (geometry)
220 {
221 AffineTransform3D* transform = geometry->GetIndexToWorldTransform();
222 if (transform)
223 {
224 result << " " << "Matrix: ";
225 const AffineTransform3D::MatrixType& matrix = transform->GetMatrix();
226 for (unsigned int i = 0; i < 3; ++i)
227 for (unsigned int j = 0; j < 3; ++j)
228 result << matrix[i][j] << " ";
229 result << "\n";
230
231 result << " " << "Offset: ";
232 const AffineTransform3D::OutputVectorType& offset = transform->GetOffset();
233 for (unsigned int i = 0; i < 3; ++i)
234 result << offset[i] << " ";
235 result << "\n";
236
237 result << " " << "Center: ";
238 const AffineTransform3D::InputPointType& center = transform->GetCenter();
239 for (unsigned int i = 0; i < 3; ++i)
240 result << center[i] << " ";
241 result << "\n";
242
243 result << " " << "Translation: ";
244 const AffineTransform3D::OutputVectorType& translation = transform->GetTranslation();
245 for (unsigned int i = 0; i < 3; ++i)
246 result << translation[i] << " ";
247 result << "\n";
248
249 result << " " << "Scale: ";
250 const double* scale = transform->GetScale();
251 for (unsigned int i = 0; i < 3; ++i)
252 result << scale[i] << " ";
253 result << "\n";

Callers 3

mainFunction · 0.80
mainFunction · 0.80

Calls 13

GetComponentTypeMethod · 0.80
GetBpeMethod · 0.80
GetMatrixMethod · 0.80
GetOffsetMethod · 0.80
GetCenterMethod · 0.80
GetPixelTypeMethod · 0.45
GetDimensionMethod · 0.45
GetOriginMethod · 0.45
GetSpacingMethod · 0.45
GetTimeBoundsMethod · 0.45

Tested by

no test coverage detected