| 249 | } |
| 250 | |
| 251 | void |
| 252 | mitk::EquiDistantBlocksSorter |
| 253 | ::Sort() |
| 254 | { |
| 255 | DICOMDatasetList remainingInput = GetInput(); // copy |
| 256 | |
| 257 | m_SliceGroupingResults.clear(); |
| 258 | |
| 259 | while (!remainingInput.empty()) // repeat until all files are grouped somehow |
| 260 | { |
| 261 | auto regularBlock = this->AnalyzeFileForITKImageSeriesReaderSpacingAssumption( remainingInput, m_AcceptTilt ); |
| 262 | |
| 263 | #ifdef MBILOG_ENABLE_DEBUG |
| 264 | DICOMDatasetList inBlock = regularBlock.GetBlockDatasets(); |
| 265 | DICOMDatasetList laterBlock = regularBlock.GetUnsortedDatasets(); |
| 266 | MITK_DEBUG << "Result: sorted 3D group with " << inBlock.size() << " files"; |
| 267 | for (DICOMDatasetList::const_iterator diter = inBlock.cbegin(); diter != inBlock.cend(); ++diter) |
| 268 | MITK_DEBUG << " IN " << (*diter)->GetFilenameIfAvailable(); |
| 269 | for (DICOMDatasetList::const_iterator diter = laterBlock.cbegin(); diter != laterBlock.cend(); ++diter) |
| 270 | MITK_DEBUG << " OUT " << (*diter)->GetFilenameIfAvailable(); |
| 271 | #endif // MBILOG_ENABLE_DEBUG |
| 272 | |
| 273 | remainingInput = regularBlock->GetUnsortedDatasets(); |
| 274 | |
| 275 | if (remainingInput.empty() && !m_SliceGroupingResults.empty() && m_SliceGroupingResults.back()->GetSplitReason()->HasReason(IOVolumeSplitReason::ReasonType::OverlappingSlices)) |
| 276 | { |
| 277 | //if all inputs are processed and there is already a preceding grouping result that has overlapping as split reason, add also overlapping as split reason for the current block |
| 278 | regularBlock->GetSplitReason()->AddReason(IOVolumeSplitReason::ReasonType::OverlappingSlices); |
| 279 | } |
| 280 | |
| 281 | m_SliceGroupingResults.push_back( regularBlock ); |
| 282 | } |
| 283 | |
| 284 | unsigned int numberOfOutputs = m_SliceGroupingResults.size(); |
| 285 | this->SetNumberOfOutputs(numberOfOutputs); |
| 286 | |
| 287 | unsigned int outputIndex(0); |
| 288 | for (auto oIter = m_SliceGroupingResults.cbegin(); |
| 289 | oIter != m_SliceGroupingResults.cend(); |
| 290 | ++outputIndex, ++oIter) |
| 291 | { |
| 292 | this->SetOutput(outputIndex, (*oIter)->GetBlockDatasets(), (*oIter)->GetSplitReason()); |
| 293 | } |
| 294 | } |
| 295 | |
| 296 | void |
| 297 | mitk::EquiDistantBlocksSorter |
nothing calls this directly
no test coverage detected