-
- // We thought this was explicit VR, but we end up with an
- // implicit VR tag. Let's backtrack.
-
- sprintf(msg,"Falsely explicit vr file (%04x,%04x)\n",
- ElVal->GetGroup(),ElVal->GetElement());
- dbg.Verbose(1, "gdcmHeader::FindVR: ",msg);
-
- fseek(fp, PositionOnEntry, SEEK_SET);
- // When this element is known in the dictionary we shall use, e.g. for
- // the semantics (see the usage of IsAnInteger), the vr proposed by the
- // dictionary entry. Still we have to flag the element as implicit since
- // we know now our assumption on expliciteness is not furfilled.
- // avoid .
- if ( ElVal->IsVrUnknown() )
- ElVal->SetVR("Implicit");
- ElVal->SetImplicitVr();
-}
-
-/**
- * \ingroup gdcmHeader
- * \brief Determines if the Transfer Syntax was already encountered
- * and if it corresponds to a ImplicitVRLittleEndian one.
- *
- * @return True when ImplicitVRLittleEndian found. False in all other cases.
- */
-bool gdcmHeader::IsImplicitVRLittleEndianTransferSyntax(void) {
- gdcmElValue* Element = PubElValSet.GetElementByNumber(0x0002, 0x0010);
- if ( !Element )
- return false;
- LoadElementValueSafe(Element);
- std::string Transfer = Element->GetValue();
- if ( Transfer == "1.2.840.10008.1.2" )
- return true;
- return false;
-}
-
-/**
- * \ingroup gdcmHeader
- * \brief Determines if the Transfer Syntax was already encountered
- * and if it corresponds to a ExplicitVRLittleEndian one.
- *
- * @return True when ExplicitVRLittleEndian found. False in all other cases.
- */
-bool gdcmHeader::IsExplicitVRLittleEndianTransferSyntax(void) {
- gdcmElValue* Element = PubElValSet.GetElementByNumber(0x0002, 0x0010);
- if ( !Element )
- return false;
- LoadElementValueSafe(Element);
- std::string Transfer = Element->GetValue();
- if ( Transfer == "1.2.840.10008.1.2.1" )
- return true;
- return false;
-}
-
-/**
- * \ingroup gdcmHeader
- * \brief Determines if the Transfer Syntax was already encountered
- * and if it corresponds to a DeflatedExplicitVRLittleEndian one.
- *
- * @return True when DeflatedExplicitVRLittleEndian found. False in all other cases.
- */
-bool gdcmHeader::IsDeflatedExplicitVRLittleEndianTransferSyntax(void) {
- gdcmElValue* Element = PubElValSet.GetElementByNumber(0x0002, 0x0010);
- if ( !Element )
- return false;
- LoadElementValueSafe(Element);
- std::string Transfer = Element->GetValue();
- if ( Transfer == "1.2.840.10008.1.2.1.99" )
- return true;
- return false;
-}
-
-/**
- * \ingroup gdcmHeader
- * \brief Determines if the Transfer Syntax was already encountered
- * and if it corresponds to a Explicit VR Big Endian one.
- *
- * @return True when big endian found. False in all other cases.
- */
-bool gdcmHeader::IsExplicitVRBigEndianTransferSyntax(void) {
- gdcmElValue* Element = PubElValSet.GetElementByNumber(0x0002, 0x0010);
- if ( !Element )
- return false;
- LoadElementValueSafe(Element);
- std::string Transfer = Element->GetValue();
- if ( Transfer == "1.2.840.10008.1.2.2" ) //1.2.2 ??? A verifier !
- return true;
- return false;
-}
-
-/**
- * \ingroup gdcmHeader
- * \brief Determines if the Transfer Syntax was already encountered
- * and if it corresponds to a JPEGBaseLineProcess1 one.
- *
- * @return True when JPEGBaseLineProcess1found. False in all other cases.
- */
-bool gdcmHeader::IsJPEGBaseLineProcess1TransferSyntax(void) {
- gdcmElValue* Element = PubElValSet.GetElementByNumber(0x0002, 0x0010);
- if ( !Element )
- return false;
- LoadElementValueSafe(Element);
- std::string Transfer = Element->GetValue();
- if ( Transfer == "1.2.840.10008.1.2.4.50" )
- return true;
- return false;
-}
-
-/**
- * \ingroup gdcmHeader
- * \brief
- *
- * @return
- */
-bool gdcmHeader::IsJPEGLossless(void) {
- gdcmElValue* Element = PubElValSet.GetElementByNumber(0x0002, 0x0010);
- // faire qq chose d'intelligent a la place de ça
- if ( !Element )
- return false;
- LoadElementValueSafe(Element);
- const char * Transfert = Element->GetValue().c_str();
- if ( memcmp(Transfert+strlen(Transfert)-2 ,"70",2)==0) return true;
- if ( memcmp(Transfert+strlen(Transfert)-2 ,"55",2)==0) return true;
- if (Element->GetValue() == "1.2.840.10008.1.2.4.57") return true;
-
- return false;
-}
-
-
-/**
- * \ingroup gdcmHeader
- * \brief Determines if the Transfer Syntax was already encountered
- * and if it corresponds to a JPEGExtendedProcess2-4 one.
- *
- * @return True when JPEGExtendedProcess2-4 found. False in all other cases.
- */
-bool gdcmHeader::IsJPEGExtendedProcess2_4TransferSyntax(void) {
- gdcmElValue* Element = PubElValSet.GetElementByNumber(0x0002, 0x0010);
- if ( !Element )
- return false;
- LoadElementValueSafe(Element);
- std::string Transfer = Element->GetValue();
- if ( Transfer == "1.2.840.10008.1.2.4.51" )
- return true;
- return false;
-}
-
-/**
- * \ingroup gdcmHeader
- * \brief Determines if the Transfer Syntax was already encountered
- * and if it corresponds to a JPEGExtendeProcess3-5 one.
- *
- * @return True when JPEGExtendedProcess3-5 found. False in all other cases.
- */
-bool gdcmHeader::IsJPEGExtendedProcess3_5TransferSyntax(void) {
- gdcmElValue* Element = PubElValSet.GetElementByNumber(0x0002, 0x0010);
- if ( !Element )
- return false;
- LoadElementValueSafe(Element);
- std::string Transfer = Element->GetValue();
- if ( Transfer == "1.2.840.10008.1.2.4.52" )
- return true;
- return false;
-}
-
-/**
- * \ingroup gdcmHeader
- * \brief Determines if the Transfer Syntax was already encountered
- * and if it corresponds to a JPEGSpectralSelectionProcess6-8 one.
- *
- * @return True when JPEGSpectralSelectionProcess6-8 found. False in all
- * other cases.
- */
-bool gdcmHeader::IsJPEGSpectralSelectionProcess6_8TransferSyntax(void) {
- gdcmElValue* Element = PubElValSet.GetElementByNumber(0x0002, 0x0010);
- if ( !Element )
- return false;
- LoadElementValueSafe(Element);
- std::string Transfer = Element->GetValue();
- if ( Transfer == "1.2.840.10008.1.2.4.53" )
- return true;
- return false;
-}
-
-/**
- * \ingroup gdcmHeader
- * \brief Determines if the Transfer Syntax was already encountered
- * and if it corresponds to a RLE Lossless one.
- *
- * @return True when RLE Lossless found. False in all
- * other cases.
- */
-bool gdcmHeader::IsRLELossLessTransferSyntax(void) {
- gdcmElValue* Element = PubElValSet.GetElementByNumber(0x0002, 0x0010);
- if ( !Element )
- return false;
- LoadElementValueSafe(Element);
- std::string Transfer = Element->GetValue();
- if ( Transfer == "1.2.840.10008.1.2.5" )
- return true;
- return false;
-}
-
-/**
- * \ingroup gdcmHeader
- * \brief Determines if the Transfer Syntax was already encountered
- * and if it corresponds to a JPEG200 one.0
- *
- * @return True when JPEG2000 (Lossly or LossLess) found. False in all
- * other cases.
- */
-bool gdcmHeader::IsJPEG2000(void) {
- gdcmElValue* Element = PubElValSet.GetElementByNumber(0x0002, 0x0010);
- if ( !Element )
- return false;
- LoadElementValueSafe(Element);
- std::string Transfer = Element->GetValue();
- if ( (Transfer == "1.2.840.10008.1.2.4.90")
- || (Transfer == "1.2.840.10008.1.2.4.91") )
- return true;
- return false;
-}