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

Method GenerateData

Modules/AlgorithmsExt/src/mitkCropTimestepsImageFilter.cpp:115–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113 }
114
115void mitk::CropTimestepsImageFilter::GenerateData()
116{
117 const auto* inputImage = this->GetInput();
118 mitk::Image::Pointer output = this->GetOutput();
119
120 if ((output->IsInitialized() == false))
121 return;
122
123 auto timeSelector = mitk::ImageTimeSelector::New();
124
125 timeSelector->SetInput(inputImage);
126
127 unsigned int timeStart = m_DesiredRegion.GetIndex(3);
128 unsigned int timeEnd = timeStart + m_DesiredRegion.GetSize(3);
129 for (unsigned int timestep = timeStart; timestep < timeEnd; ++timestep)
130 {
131 timeSelector->SetTimeNr(timestep);
132 timeSelector->UpdateLargestPossibleRegion();
133 mitk::ImageReadAccessor imageAccessorWithOneTimestep(timeSelector->GetOutput());
134 output->SetVolume(imageAccessorWithOneTimestep.GetData(), timestep-timeStart);
135 }
136}
137
138void mitk::CropTimestepsImageFilter::SetInput(const InputImageType* image)
139{

Callers

nothing calls this directly

Calls 9

SetVolumeMethod · 0.80
NewFunction · 0.50
GetInputMethod · 0.45
GetOutputMethod · 0.45
IsInitializedMethod · 0.45
SetInputMethod · 0.45
GetIndexMethod · 0.45
GetSizeMethod · 0.45
GetDataMethod · 0.45

Tested by

no test coverage detected