Mercurial > hg > orthanc
comparison OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp @ 4845:02d77189d8ba received-instance-callback
added ReceivedInstanceCallback + sample C++ plugin
author | Alain Mazy <am@osimis.io> |
---|---|
date | Thu, 09 Dec 2021 17:22:40 +0100 |
parents | 7053502fbf97 |
children | 43e613a7756b |
comparison
equal
deleted
inserted
replaced
4844:55e8fb8e8028 | 4845:02d77189d8ba |
---|---|
732 case EVR_UNKNOWN2B: // used internally for elements with unknown VR with 2-byte length field in explicit VR | 732 case EVR_UNKNOWN2B: // used internally for elements with unknown VR with 2-byte length field in explicit VR |
733 { | 733 { |
734 if (!(flags & DicomToJsonFlags_ConvertBinaryToNull)) | 734 if (!(flags & DicomToJsonFlags_ConvertBinaryToNull)) |
735 { | 735 { |
736 Uint8* data = NULL; | 736 Uint8* data = NULL; |
737 Uint16* data16 = NULL; | |
737 if (element.getUint8Array(data) == EC_Normal) | 738 if (element.getUint8Array(data) == EC_Normal) |
738 { | 739 { |
739 return new DicomValue(reinterpret_cast<const char*>(data), element.getLength(), true); | 740 return new DicomValue(reinterpret_cast<const char*>(data), element.getLength(), true); |
741 } | |
742 else if (element.getUint16Array(data16) == EC_Normal) | |
743 { | |
744 return new DicomValue(reinterpret_cast<const char*>(data16), element.getLength(), true); | |
740 } | 745 } |
741 } | 746 } |
742 | 747 |
743 return new DicomValue; | 748 return new DicomValue; |
744 } | 749 } |
1849 { | 1854 { |
1850 ok = element.putUint32(boost::lexical_cast<Uint32>(*decoded)).good(); | 1855 ok = element.putUint32(boost::lexical_cast<Uint32>(*decoded)).good(); |
1851 break; | 1856 break; |
1852 } | 1857 } |
1853 | 1858 |
1859 case EVR_xs: // unsigned short, signed short or multiple values | |
1860 { | |
1861 if (decoded->find('\\') != std::string::npos) | |
1862 { | |
1863 ok = element.putString(decoded->c_str()).good(); | |
1864 } | |
1865 else if (decoded->find('-') != std::string::npos) | |
1866 { | |
1867 ok = element.putSint16(boost::lexical_cast<Sint16>(*decoded)).good(); | |
1868 } | |
1869 else | |
1870 { | |
1871 ok = element.putUint16(boost::lexical_cast<Uint16>(*decoded)).good(); | |
1872 } | |
1873 break; | |
1874 } | |
1875 | |
1854 case EVR_US: // unsigned short | 1876 case EVR_US: // unsigned short |
1855 { | 1877 { |
1856 ok = element.putUint16(boost::lexical_cast<Uint16>(*decoded)).good(); | 1878 ok = element.putUint16(boost::lexical_cast<Uint16>(*decoded)).good(); |
1857 break; | 1879 break; |
1858 } | 1880 } |
1900 /** | 1922 /** |
1901 * Internal to DCMTK. | 1923 * Internal to DCMTK. |
1902 **/ | 1924 **/ |
1903 | 1925 |
1904 case EVR_ox: // OB or OW depending on context | 1926 case EVR_ox: // OB or OW depending on context |
1905 case EVR_xs: // SS or US depending on context | |
1906 case EVR_lt: // US, SS or OW depending on context, used for LUT Data (thus the name) | 1927 case EVR_lt: // US, SS or OW depending on context, used for LUT Data (thus the name) |
1907 case EVR_na: // na="not applicable", for data which has no VR | 1928 case EVR_na: // na="not applicable", for data which has no VR |
1908 case EVR_up: // up="unsigned pointer", used internally for DICOMDIR suppor | 1929 case EVR_up: // up="unsigned pointer", used internally for DICOMDIR suppor |
1909 case EVR_item: // used internally for items | 1930 case EVR_item: // used internally for items |
1910 case EVR_metainfo: // used internally for meta info datasets | 1931 case EVR_metainfo: // used internally for meta info datasets |