55 if (
const Self* otherSelf = dynamic_cast<const Self*>(&other))
59 && this->m_Group3DandT == otherSelf->m_Group3DandT;
87 return resultOf3DGrouping;
94 std::vector<unsigned int> true3DnTBlocksTimeStepCount;
98 const DICOMTag tagImagePositionPatient(0x0020, 0x0032);
100 while (!remainingBlocks.empty())
105 int current3DnTBlockNumberOfTimeSteps = 1;
108 const unsigned int currentBlockNumberOfSlices = firstBlock.size();
109 const std::string currentBlockFirstOrigin = firstBlock.front()->GetTagValueAsString( tagImagePositionPatient ).value;
110 const std::string currentBlockLastOrigin = firstBlock.back()->GetTagValueAsString( tagImagePositionPatient ).value;
112 remainingBlocks.erase( remainingBlocks.begin() );
115 for (
auto otherBlockIter = remainingBlocks.begin();
116 otherBlockIter != remainingBlocks.cend();
122 const unsigned int otherBlockNumberOfSlices = otherBlock.size();
123 const std::string otherBlockFirstOrigin = otherBlock.front()->GetTagValueAsString( tagImagePositionPatient ).value;
124 const std::string otherBlockLastOrigin = otherBlock.back()->GetTagValueAsString( tagImagePositionPatient ).value;
128 if ( otherBlockNumberOfSlices == currentBlockNumberOfSlices
129 && otherBlockFirstOrigin == currentBlockFirstOrigin
130 && otherBlockLastOrigin == currentBlockLastOrigin
133 ++current3DnTBlockNumberOfTimeSteps;
134 current3DnTBlock.insert( current3DnTBlock.end(), otherBlock.begin(), otherBlock.end() );
136 otherBlockIter = remainingBlocks.erase(otherBlockIter);
146 if (current3DnTBlockNumberOfTimeSteps > 1)
148 true3DnTBlocks.push_back(current3DnTBlock);
149 true3DnTBlocksTimeStepCount.push_back(current3DnTBlockNumberOfTimeSteps);
153 non3DnTBlocks.push_back(current3DnTBlock);
159 this->SetNumberOfOutputs( true3DnTBlocks.size() );
161 for (
auto blockIter = true3DnTBlocks.cbegin();
162 blockIter != true3DnTBlocks.cend();
167 assert(!gdcmFrameInfoList.empty());
172 m_NormalDirectionConsistencySorter->SetInput( datasetList );
173 m_NormalDirectionConsistencySorter->Sort();
179 assert(!frameList.empty());
183 block.SetAdditionalTagsOfInterest(GetAdditionalTagsOfInterest());
184 block.SetTagLookupTableToPropertyFunctor(GetTagLookupTableToPropertyFunctor());
185 block.SetImageFrameList( frameList );
186 block.SetTiltInformation( tiltInfo );
188 block.SetFlag(
"3D+t",
true);
189 block.SetIntProperty(
"timesteps", true3DnTBlocksTimeStepCount[o]);
190 MITK_DEBUG <<
"Found " << true3DnTBlocksTimeStepCount[o] <<
" timesteps";
192 this->SetOutput( o, block );
195 return non3DnTBlocks;
204 unsigned int numberOfOutputs = this->GetNumberOfOutputs();
205 for (
unsigned int o = 0; o < numberOfOutputs; ++o)
209 if (block.
GetFlag(
"3D+t",
false))
211 success &= this->LoadMitkImageForOutput(o);
233 if (numberOfTimesteps == 1)
241 for (
int timeStep = 0; timeStep<numberOfTimesteps; ++timeStep)
245 auto timeStepStart = frames.cbegin() + timeStep * numberOfFramesPerTimestep;
246 auto timeStepEnd = frames.cbegin() + (timeStep+1) * numberOfFramesPerTimestep;
247 for (
auto frameIter = timeStepStart;
248 frameIter != timeStepEnd;
251 filenamesOfThisTimeStep.push_back( (*frameIter)->Filename );
253 filenamesPerTimestep.push_back( filenamesOfThisTimeStep );
section MAP_FRAME_Mapper_Settings Mapper settings For the mapping of corrected you have several settings but high interpolation errors for gray value images Right choice for label images or masks li Details of the frame selection In this tab you can specify the frames of the currently selected image that should be corrected As default all frames of an image will be corrected If you only select specific frames
const DICOMImageFrameList & GetImageFrameList() const
List of frames that constitute the mitk::Image (DICOMImageFrames)
virtual bool operator==(const DICOMFileReader &other) const override
Flexible reader based on itk::ImageSeriesReader and GDCM, for single-slice modalities like CT...
virtual bool operator==(const DICOMFileReader &other) const override
Representation of a DICOM tag.
const GantryTiltInformation GetTiltInformation() const
Describe the gantry tilt of the acquisition.
int GetNumberOfFramesPerTimeStep() const
MITKDICOMREADER_EXPORT mitk::DICOMDatasetList ConvertToDICOMDatasetList(const DICOMDatasetAccessingImageFrameList &input)
MITKDICOMREADER_EXPORT mitk::DICOMDatasetAccessingImageFrameList ConvertToDICOMDatasetAccessingImageFrameList(const DICOMDatasetList &input)
void SetMitkImage(Image::Pointer image)
The 3D mitk::Image that is loaded from the DICOM files of a DICOMImageFrameList.
ThreeDnTDICOMSeriesReader(unsigned int decimalPlacesForOrientation=5)
Image::Pointer Load3DnT(const StringContainerList &filenamesLists, bool correctTilt, const GantryTiltInformation &tiltInfo)
virtual SortingBlockList Condense3DBlocks(SortingBlockList &) override
Analyze the groups produced by DICOMITKSeriesGDCMReader for 3D+t properties. This method tests whethe...
std::vector< DICOMImageFrameInfo::Pointer > DICOMImageFrameList
void SetGroup3DandT(bool on)
Control whether 3D+t grouping shall actually be attempted.
virtual bool LoadMitkImageForImageBlockDescriptor(DICOMImageBlockDescriptor &block) const
int GetNumberOfTimeSteps() const
bool GetFlag(const std::string &key, bool defaultValue) const
Convenience function around GetProperty()
Output descriptor for DICOMFileReader.
void SetTagCache(DICOMTagCache *privateCache)
bool LoadMitkImageForImageBlockDescriptor(DICOMImageBlockDescriptor &block) const override
ThreeDnTDICOMSeriesReader & operator=(const ThreeDnTDICOMSeriesReader &other)
Extends DICOMITKSeriesGDCMReader by sorting/grouping into 3D+t image blocks.
virtual bool LoadImages() override
Load via multiple calls to itk::ImageSeriesReader.
std::list< StringContainer > StringContainerList
virtual bool LoadMitkImageForOutput(unsigned int o)
Loads the mitk::Image by means of an itk::ImageSeriesReader.
std::vector< DICOMDatasetAccessingImageFrameList > SortingBlockList
MITKDICOMREADER_EXPORT mitk::DICOMImageFrameList ConvertToDICOMImageFrameList(const DICOMDatasetAccessingImageFrameList &input)
std::vector< DICOMDatasetAccessingImageFrameInfo::Pointer > DICOMDatasetAccessingImageFrameList
virtual ~ThreeDnTDICOMSeriesReader()
bool GetGroup3DandT() const
DICOMITKSeriesGDCMReader & operator=(const DICOMITKSeriesGDCMReader &other)
std::vector< DICOMDatasetAccess * > DICOMDatasetList
Interface for DICOM readers that produce mitk::Images.
std::vector< std::string > StringContainer