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

Method GenerateData

Modules/CEST/src/mitkCESTImageNormalizationFilter.cpp:31–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29}
30
31void mitk::CESTImageNormalizationFilter::GenerateData()
32{
33 mitk::Image::ConstPointer inputImage = this->GetInput(0);
34 if ((inputImage->GetDimension() != 4))
35 {
36 mitkThrow() << "mitk::CESTImageNormalizationFilter:GenerateData works only with 4D images, sorry.";
37 return;
38 }
39
40 auto resultMitkImage = this->GetOutput();
41 AccessFixedDimensionByItk(inputImage, NormalizeTimeSteps, 4);
42
43 auto originalTimeGeometry = this->GetInput()->GetTimeGeometry();
44 auto resultTimeGeometry = mitk::ProportionalTimeGeometry::New();
45
46 unsigned int numberOfNonM0s = m_NonM0Indices.size();
47 resultTimeGeometry->Expand(numberOfNonM0s);
48
49 for (unsigned int index = 0; index < numberOfNonM0s; ++index)
50 {
51 resultTimeGeometry->SetTimeStepGeometry(originalTimeGeometry->GetGeometryCloneForTimeStep(m_NonM0Indices.at(index)), index);
52 }
53 resultMitkImage->SetTimeGeometry(resultTimeGeometry);
54
55 resultMitkImage->SetPropertyList(this->GetInput()->GetPropertyList()->Clone());
56 resultMitkImage->GetPropertyList()->SetStringProperty(CEST_PROPERTY_NAME_OFFSETS().c_str(), m_RealOffsets.c_str());
57 // remove uids
58 resultMitkImage->GetPropertyList()->DeleteProperty("DICOM.0008.0018");
59 resultMitkImage->GetPropertyList()->DeleteProperty("DICOM.0020.000D");
60 resultMitkImage->GetPropertyList()->DeleteProperty("DICOM.0020.000E");
61
62}
63
64template <typename TPixel, unsigned int VImageDimension>
65void mitk::CESTImageNormalizationFilter::NormalizeTimeSteps(const itk::Image<TPixel, VImageDimension>* image)

Callers

nothing calls this directly

Calls 15

atMethod · 0.80
SetTimeGeometryMethod · 0.80
DeletePropertyMethod · 0.80
NewFunction · 0.50
GetInputMethod · 0.45
GetDimensionMethod · 0.45
GetOutputMethod · 0.45
sizeMethod · 0.45
ExpandMethod · 0.45
SetTimeStepGeometryMethod · 0.45
SetPropertyListMethod · 0.45

Tested by

no test coverage detected