Mercurial > hg > orthanc
comparison Core/DicomFormat/DicomMap.cpp @ 2412:cad393b41bc3
handy shortcuts in DicomMap
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 29 Sep 2017 11:35:45 +0200 |
parents | 96b3ec054b69 |
children | 878b59270859 |
comparison
equal
deleted
inserted
replaced
2411:82d5e305fbd9 | 2412:cad393b41bc3 |
---|---|
863 else | 863 else |
864 { | 864 { |
865 LOG(ERROR) << "Store has failed because required tags (" << s << ") are missing for the following instance: " << t; | 865 LOG(ERROR) << "Store has failed because required tags (" << s << ") are missing for the following instance: " << t; |
866 } | 866 } |
867 } | 867 } |
868 | |
869 | |
870 bool DicomMap::CopyToString(std::string& result, | |
871 const DicomTag& tag, | |
872 bool allowBinary) const | |
873 { | |
874 const DicomValue* value = TestAndGetValue(tag); | |
875 | |
876 if (value == NULL) | |
877 { | |
878 return false; | |
879 } | |
880 else | |
881 { | |
882 return value->CopyToString(result, allowBinary); | |
883 } | |
884 } | |
885 | |
886 bool DicomMap::ParseInteger32(int32_t& result, | |
887 const DicomTag& tag) const | |
888 { | |
889 const DicomValue* value = TestAndGetValue(tag); | |
890 | |
891 if (value == NULL) | |
892 { | |
893 return false; | |
894 } | |
895 else | |
896 { | |
897 return value->ParseInteger32(result); | |
898 } | |
899 } | |
900 | |
901 bool DicomMap::ParseInteger64(int64_t& result, | |
902 const DicomTag& tag) const | |
903 { | |
904 const DicomValue* value = TestAndGetValue(tag); | |
905 | |
906 if (value == NULL) | |
907 { | |
908 return false; | |
909 } | |
910 else | |
911 { | |
912 return value->ParseInteger64(result); | |
913 } | |
914 } | |
915 | |
916 bool DicomMap::ParseUnsignedInteger32(uint32_t& result, | |
917 const DicomTag& tag) const | |
918 { | |
919 const DicomValue* value = TestAndGetValue(tag); | |
920 | |
921 if (value == NULL) | |
922 { | |
923 return false; | |
924 } | |
925 else | |
926 { | |
927 return value->ParseUnsignedInteger32(result); | |
928 } | |
929 } | |
930 | |
931 bool DicomMap::ParseUnsignedInteger64(uint64_t& result, | |
932 const DicomTag& tag) const | |
933 { | |
934 const DicomValue* value = TestAndGetValue(tag); | |
935 | |
936 if (value == NULL) | |
937 { | |
938 return false; | |
939 } | |
940 else | |
941 { | |
942 return value->ParseUnsignedInteger64(result); | |
943 } | |
944 } | |
945 | |
946 bool DicomMap::ParseFloat(float& result, | |
947 const DicomTag& tag) const | |
948 { | |
949 const DicomValue* value = TestAndGetValue(tag); | |
950 | |
951 if (value == NULL) | |
952 { | |
953 return false; | |
954 } | |
955 else | |
956 { | |
957 return value->ParseFloat(result); | |
958 } | |
959 } | |
960 | |
961 bool DicomMap::ParseDouble(double& result, | |
962 const DicomTag& tag) const | |
963 { | |
964 const DicomValue* value = TestAndGetValue(tag); | |
965 | |
966 if (value == NULL) | |
967 { | |
968 return false; | |
969 } | |
970 else | |
971 { | |
972 return value->ParseDouble(result); | |
973 } | |
974 } | |
868 } | 975 } |