| 29 | } |
| 30 | |
| 31 | void 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 | |
| 64 | template <typename TPixel, unsigned int VImageDimension> |
| 65 | void mitk::CESTImageNormalizationFilter::NormalizeTimeSteps(const itk::Image<TPixel, VImageDimension>* image) |
nothing calls this directly
no test coverage detected