Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Don't check functional groups (speedup) #479

Merged
merged 1 commit into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading