Skip to content

Commit

Permalink
Merge pull request #479 from michaelonken/no-functional-group-checking
Browse files Browse the repository at this point in the history
ENH: Don't check functional groups (speedup)
  • Loading branch information
fedorov authored Nov 1, 2023
2 parents f41acf2 + c9d56cb commit 2b3c928
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libsrc/ImageSEGConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,10 @@ namespace dcmqi {
CHECK_COND(segdoc->getFrameOfReference().setFrameOfReferenceUID(frameOfRefUIDchar));
}

// Don't check functional groups since its very time consuming and we trust
// ourselves to put together valid datasets
segdoc->setCheckFGOnWrite(OFFalse);

OFCondition writeResult = segdoc->writeDataset(segdocDataset);
if(writeResult.bad()){
cerr << "FATAL ERROR: Writing of the SEG dataset failed!";
Expand Down Expand Up @@ -482,7 +486,7 @@ namespace dcmqi {

pair <map<unsigned,ShortImageType::Pointer>, string> ImageSEGConverter::dcmSegmentation2itkimage(DcmDataset *segDataset) {
DcmSegmentation *segdoc = NULL;

DcmRLEDecoderRegistration::registerCodecs();

OFCondition cond = DcmSegmentation::loadDataset(*segDataset, segdoc);
Expand Down
4 changes: 4 additions & 0 deletions libsrc/ParaMapConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,10 @@ namespace dcmqi {
pMapDoc->getSeries().setSeriesNumber(metaInfo.getSeriesNumber().c_str());

DcmDataset* output = new DcmDataset();

// Don't check functional groups since its very time consuming and we trust
// ourselves to put together valid datasets
pMapDoc->getFunctionalGroups().setCheckOnWrite(OFFalse);
CHECK_COND(pMapDoc->writeDataset(*output));
return output;
}
Expand Down

0 comments on commit 2b3c928

Please sign in to comment.