DictEntry or the VR.
-- BeNours
+2005-01-19 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
+ * src/gdcmDocEntry.h : DocEntry is now secure. User can't change the
+ DictEntry or the VR.
+
2005-01-19 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
* gdcmPython/ : change GDCM_DATA_PATH to GDCM_DATA_ROOT to be complient with
all in gdcm
Program: gdcm
Module: $RCSfile: gdcmBinEntry.cxx,v $
Language: C++
- Date: $Date: 2005/01/16 04:50:41 $
- Version: $Revision: 1.53 $
+ Date: $Date: 2005/01/19 15:58:00 $
+ Version: $Revision: 1.54 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
BinEntry::BinEntry(DocEntry *e) : ValEntry(e->GetDictEntry())
{
Copy(e);
-/* Length = e->GetLength();
- ReadLength = e->GetReadLength();
- ImplicitVR = e->IsImplicitVR();
- Offset = e->GetOffset();*/
//FIXME
//SQDepthLevel = e->GetDepthLevel();
Program: gdcm
Module: $RCSfile: gdcmDocEntry.cxx,v $
Language: C++
- Date: $Date: 2005/01/18 14:28:32 $
- Version: $Revision: 1.43 $
+ Date: $Date: 2005/01/19 15:58:00 $
+ Version: $Revision: 1.44 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* \brief Copies all the attributes from an other DocEntry
* @param e entry to copy from
*/
-void DocEntry::Copy (DocEntry *e)
+void DocEntry::Copy(DocEntry *e)
{
Length = e->Length;
ReadLength = e->ReadLength;
Program: gdcm
Module: $RCSfile: gdcmDocEntry.h,v $
Language: C++
- Date: $Date: 2005/01/16 04:50:41 $
- Version: $Revision: 1.38 $
+ Date: $Date: 2005/01/19 15:58:00 $
+ Version: $Revision: 1.39 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
/// of the current Dicom Header Entry
std::string const &GetVM() const { return DicomDict->GetVM(); };
- /// Sets the 'Value Representation' of the current Dicom Header Entry
- void SetVR( TagName const &v) { DicomDict->SetVR(v); };
-
/// Sets the 'Value Multiplicity' of the current Dicom Header Entry
void SetVM( TagName const &v) { DicomDict->SetVM(v); };
/// @return true if the VM is unknown
bool IsVMUnknown() { return DicomDict->IsVMUnknown(); };
- /// \brief Sets the DicEntry of the current Dicom Element
- /// @param newEntry pointer to the DictEntry
- void SetDictEntry(DictEntry *newEntry) { DicomDict = newEntry; };
-
/// \brief Gets the DicEntry of the current Dicom Element
/// @return The DicEntry of the current Dicom Element
DictEntry * GetDictEntry() { return DicomDict; };
virtual void Print (std::ostream &os = std::cout, std::string const & indent = "");
protected:
-// Variables
+ /// \brief Sets the DicEntry of the current Dicom Element
+ /// \remarks Used only by the Header !!! (possible because of a friend
+ /// link between them)
+ /// @param newEntry pointer to the DictEntry
+ void SetDictEntry(DictEntry *newEntry) { DicomDict = newEntry; };
+// Variables
/// \brief pointer to the underlying Dicom dictionary element
DictEntry *DicomDict;
Program: gdcm
Module: $RCSfile: gdcmDocument.cxx,v $
Language: C++
- Date: $Date: 2005/01/19 10:30:51 $
- Version: $Revision: 1.199 $
+ Date: $Date: 2005/01/19 15:58:00 $
+ Version: $Revision: 1.200 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
// hands on a big endian encoded file: we switch the swap code to
// big endian and proceed...
- //
- // if ( element == 0x0000 && length16 == 0x0400 )
- // {
- // std::string ts = GetTransferSyntax();
- // if ( Global::GetTS()->GetSpecialTransferSyntax(ts)
- // != TS::ExplicitVRBigEndian )
- // {
- // throw FormatError( "Document::FindDocEntryLength()",
- // " not explicit VR." );
- // return;
- // }
- // length16 = 4;
- // SwitchByteSwapCode();
-
- // Restore the unproperly loaded values i.e. the group, the element
- // and the dictionary entry depending on them.
-// uint16_t correctGroup = SwapShort( entry->GetGroup() );
+// if ( element == 0x0000 && length16 == 0x0400 )
+// {
+// std::string ts = GetTransferSyntax();
+// if ( Global::GetTS()->GetSpecialTransferSyntax(ts)
+// != TS::ExplicitVRBigEndian )
+// {
+// throw FormatError( "Document::FindDocEntryLength()",
+// " not explicit VR." );
+// return;
+// }
+// length16 = 4;
+// SwitchByteSwapCode();
+//
+// // Restore the unproperly loaded values i.e. the group, the element
+// // and the dictionary entry depending on them.
+// uint16_t correctGroup = SwapShort( entry->GetGroup() );
// uint16_t correctElem = SwapShort( entry->GetElement() );
-// DictEntry *newTag = GetDictEntry( correctGroup, correctElem ); if ( !newTag )
+// DictEntry *newTag = GetDictEntry( correctGroup, correctElem );
+// if ( !newTag )
// {
- // This correct tag is not in the dictionary. Create a new one.
+// // This correct tag is not in the dictionary. Create a new one.
// newTag = NewVirtualDictEntry(correctGroup, correctElem);
// }
- // FIXME this can create a memory leaks on the old entry that be
- // left unreferenced.
+// // FIXME this can create a memory leaks on the old entry that be
+// // left unreferenced.
// entry->SetDictEntry( newTag );
// }
-
// 0xffff means that we deal with 'No Length' Sequence
// or 'No Length' SQItem
Program: gdcm
Module: $RCSfile: gdcmHeader.cxx,v $
Language: C++
- Date: $Date: 2005/01/18 16:23:52 $
- Version: $Revision: 1.234 $
+ Date: $Date: 2005/01/19 15:58:00 $
+ Version: $Revision: 1.235 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
// Now, we know GrPixel and NumPixel.
// Let's create a VirtualDictEntry to allow a further VR modification
// and force VR to match with BitsAllocated.
-
DocEntry *entry = GetDocEntry(GrPixel, NumPixel);
if ( entry != 0 )
{
PixelVR, "PXL", "Pixel Data");
entry->SetDictEntry( newEntry );
- }
+ }
}
/**
Program: gdcm
Module: $RCSfile: gdcmValEntry.cxx,v $
Language: C++
- Date: $Date: 2005/01/17 01:14:33 $
- Version: $Revision: 1.47 $
+ Date: $Date: 2005/01/19 15:58:01 $
+ Version: $Revision: 1.48 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
: DocEntry(e->GetDictEntry())
{
Copy(e);
-/* Length = e->GetLength();
- ReadLength = e->GetReadLength();
- ImplicitVR = e->IsImplicitVR();
- Offset = e->GetOffset();*/
}