Mercurial > hg > orthanc-wsi
comparison Applications/Dicomizer.cpp @ 168:d3aea0af03e1
attempt to fix issue #139
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 12 Jul 2019 12:51:17 +0200 |
parents | 605247fc8758 |
children | de783db2a7c3 |
comparison
equal
deleted
inserted
replaced
167:605247fc8758 | 168:d3aea0af03e1 |
---|---|
388 | 388 |
389 | 389 |
390 { | 390 { |
391 // Construct tag "Shared Functional Groups Sequence" (5200,9229) | 391 // Construct tag "Shared Functional Groups Sequence" (5200,9229) |
392 | 392 |
393 #if 1 | |
393 // In the 2 lines below, remember to switch X/Y when going from physical to pixel coordinates! | 394 // In the 2 lines below, remember to switch X/Y when going from physical to pixel coordinates! |
394 float spacingX = volume.GetWidth() / static_cast<float>(source.GetLevelHeight(0)); | 395 float spacingX = volume.GetWidth() / static_cast<float>(source.GetLevelHeight(0)); |
395 float spacingY = volume.GetHeight() / static_cast<float>(source.GetLevelWidth(0)); | 396 float spacingY = volume.GetHeight() / static_cast<float>(source.GetLevelWidth(0)); |
396 | 397 |
397 std::string spacing = (boost::lexical_cast<std::string>(spacingX) + '\\' + | 398 std::string spacing = (boost::lexical_cast<std::string>(spacingX) + '\\' + |
418 !sequence->insert(item.release(), false, false).good() || | 419 !sequence->insert(item.release(), false, false).good() || |
419 !dataset.insert(sequence.release(), true /* replace */, false).good()) | 420 !dataset.insert(sequence.release(), true /* replace */, false).good()) |
420 { | 421 { |
421 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError); | 422 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError); |
422 } | 423 } |
424 #else | |
425 std::auto_ptr<DcmItem> item(new DcmItem); | |
426 | |
427 std::auto_ptr<DcmItem> item3(new DcmItem); | |
428 OrthancWSI::DicomToolbox::SetStringTag(*item3, DCM_OpticalPathIdentifier, opticalPathId); | |
429 | |
430 std::auto_ptr<DcmSequenceOfItems> sequence(new DcmSequenceOfItems(DCM_SharedFunctionalGroupsSequence)); | |
431 std::auto_ptr<DcmSequenceOfItems> sequence3(new DcmSequenceOfItems(DCM_OpticalPathIdentificationSequence)); | |
432 | |
433 if (!sequence3->insert(item3.release(), false, false).good() || | |
434 !item->insert(sequence3.release(), false, false).good() || | |
435 !sequence->insert(item.release(), false, false).good() || | |
436 !dataset.insert(sequence.release(), true /* replace */, false).good()) | |
437 { | |
438 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError); | |
439 } | |
440 #endif | |
423 } | 441 } |
424 } | 442 } |
425 | 443 |
426 | 444 |
427 static void EnrichDataset(DcmDataset& dataset, | 445 static void EnrichDataset(DcmDataset& dataset, |