Mercurial > hg > orthanc
comparison Core/DicomParsing/ParsedDicomFile.cpp @ 3920:82e88ff003d7 c-get
merge default -> c-get
author | Alain Mazy <alain@mazy.be> |
---|---|
date | Tue, 12 May 2020 14:58:24 +0200 |
parents | 7610af1532c3 |
children | aae045f802f4 |
comparison
equal
deleted
inserted
replaced
3918:dba48c162b7b | 3920:82e88ff003d7 |
---|---|
454 #if ORTHANC_ENABLE_CIVETWEB == 1 || ORTHANC_ENABLE_MONGOOSE == 1 | 454 #if ORTHANC_ENABLE_CIVETWEB == 1 || ORTHANC_ENABLE_MONGOOSE == 1 |
455 void ParsedDicomFile::SendPathValue(RestApiOutput& output, | 455 void ParsedDicomFile::SendPathValue(RestApiOutput& output, |
456 const UriComponents& uri) | 456 const UriComponents& uri) |
457 { | 457 { |
458 DcmItem* dicom = pimpl_->file_->getDataset(); | 458 DcmItem* dicom = pimpl_->file_->getDataset(); |
459 E_TransferSyntax transferSyntax = pimpl_->file_->getDataset()->getOriginalXfer(); | 459 E_TransferSyntax transferSyntax = pimpl_->file_->getDataset()->getCurrentXfer(); |
460 | 460 |
461 // Special case: Accessing the pixel data | 461 // Special case: Accessing the pixel data |
462 if (uri.size() == 1 || | 462 if (uri.size() == 1 || |
463 uri.size() == 2) | 463 uri.size() == 2) |
464 { | 464 { |
867 void ParsedDicomFile::Answer(RestApiOutput& output) | 867 void ParsedDicomFile::Answer(RestApiOutput& output) |
868 { | 868 { |
869 std::string serialized; | 869 std::string serialized; |
870 if (FromDcmtkBridge::SaveToMemoryBuffer(serialized, *pimpl_->file_->getDataset())) | 870 if (FromDcmtkBridge::SaveToMemoryBuffer(serialized, *pimpl_->file_->getDataset())) |
871 { | 871 { |
872 output.AnswerBuffer(serialized, MimeType_Binary); | 872 output.AnswerBuffer(serialized, MimeType_Dicom); |
873 } | 873 } |
874 } | 874 } |
875 #endif | 875 #endif |
876 | 876 |
877 | 877 |
1111 { | 1111 { |
1112 pimpl_->file_.reset(new DcmFileFormat(dicom)); | 1112 pimpl_->file_.reset(new DcmFileFormat(dicom)); |
1113 } | 1113 } |
1114 | 1114 |
1115 | 1115 |
1116 ParsedDicomFile::ParsedDicomFile(DcmFileFormat* dicom) : pimpl_(new PImpl) | |
1117 { | |
1118 pimpl_->file_.reset(dicom); // No cloning | |
1119 } | |
1120 | |
1121 | |
1116 DcmFileFormat& ParsedDicomFile::GetDcmtkObject() const | 1122 DcmFileFormat& ParsedDicomFile::GetDcmtkObject() const |
1117 { | 1123 { |
1118 return *pimpl_->file_.get(); | 1124 return *pimpl_->file_.get(); |
1119 } | 1125 } |
1120 | 1126 |
1562 pimpl_->frameIndex_.reset(new DicomFrameIndex(*pimpl_->file_->getDataset())); | 1568 pimpl_->frameIndex_.reset(new DicomFrameIndex(*pimpl_->file_->getDataset())); |
1563 } | 1569 } |
1564 | 1570 |
1565 pimpl_->frameIndex_->GetRawFrame(target, frameId); | 1571 pimpl_->frameIndex_->GetRawFrame(target, frameId); |
1566 | 1572 |
1567 E_TransferSyntax transferSyntax = pimpl_->file_->getDataset()->getOriginalXfer(); | 1573 E_TransferSyntax transferSyntax = pimpl_->file_->getDataset()->getCurrentXfer(); |
1568 switch (transferSyntax) | 1574 switch (transferSyntax) |
1569 { | 1575 { |
1570 case EXS_JPEGProcess1: | 1576 case EXS_JPEGProcess1: |
1571 mime = MimeType_Jpeg; | 1577 mime = MimeType_Jpeg; |
1572 break; | 1578 break; |
1623 } | 1629 } |
1624 | 1630 |
1625 | 1631 |
1626 bool ParsedDicomFile::LookupTransferSyntax(std::string& result) | 1632 bool ParsedDicomFile::LookupTransferSyntax(std::string& result) |
1627 { | 1633 { |
1628 return FromDcmtkBridge::LookupTransferSyntax(result, *pimpl_->file_); | 1634 // TODO - Shouldn't "dataset.getCurrentXfer()" be used instead of |
1635 // using the meta header? | |
1636 const char* value = NULL; | |
1637 | |
1638 assert(pimpl_->file_ != NULL); | |
1639 if (pimpl_->file_->getMetaInfo() != NULL && | |
1640 pimpl_->file_->getMetaInfo()->findAndGetString(DCM_TransferSyntaxUID, value).good() && | |
1641 value != NULL) | |
1642 { | |
1643 result.assign(value); | |
1644 return true; | |
1645 } | |
1646 else | |
1647 { | |
1648 return false; | |
1649 } | |
1629 } | 1650 } |
1630 | 1651 |
1631 | 1652 |
1632 bool ParsedDicomFile::LookupPhotometricInterpretation(PhotometricInterpretation& result) const | 1653 bool ParsedDicomFile::LookupPhotometricInterpretation(PhotometricInterpretation& result) const |
1633 { | 1654 { |