X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=Doc%2FWebsite%2FNews.html;h=9b8e5fba7c19939da00f1d6dbcc71c11a31b71de;hb=20f7cba5b9d4012e8f038e47588c4de3962d147c;hp=01f4c67dbc3502a7cc374d4f365558722b0390ac;hpb=ba2ea83f67d798dfa2efae2fb21d3b5858c9c95c;p=gdcm.git diff --git a/Doc/Website/News.html b/Doc/Website/News.html index 01f4c67d..9b8e5fba 100644 --- a/Doc/Website/News.html +++ b/Doc/Website/News.html @@ -7,111 +7,669 @@
- + ++ ValEntry(DictEntry *e); + BinEntry(DictEntry *e); +-->DataEntry *New(uint16_t group,uint16_t elem, VRKey const &vr); + std::string const &ValEntry::GetValue() const; + std::string const &BinEntry::GetValue() const; +-->std::string const &DataEntry::GetString() const; + + uint8_t *BinEntry::GetBinArea(); +-->uint8_t *DataEntry::GetBinArea(); + + void ValEntry::SetValue(std::string const &value); + void BinEntry::SetValue(std::string const &value); +-->void DataEntry::SetString(std::string const &value); + + void BinEntry::SetBinArea( uint8_t *area, bool self = true ); +-->void DataEntry::SetBinArea( uint8_t *area, bool self = true ); + + void ValEntry::CopyValEntry(uint16_t gr, uint16_t el); +-->void DataEntry::CopyDataEntry(uint16_t gr, uint16_t el, VRKey const &vr); +-
-For people who get this new release : - -We consider now that : -- any dicom related file is a gdcm::Document. -- a gdcm::Document can be : - - a gdcm::File, if it contains pixel data, - - a gdcm::DicomDir, if it contains only informations - on the files in a given directory - -- in a gdcm::Document, there are gdcm::DocEntry, that can be : - - gdcm::ContentEntry (any entry that has an actual value, - *not* an embedded set of other gdcm::DocEntry) - a gdcm::ContentEntry can be : - - gdcm::ValEntry (whose value is std::string representable - e.g. character values, or integers), - - gdcm::BinEntry (whose value is not std::string representable - e.g. color palettes, overlays, icons , ...) - - gdcm::Sequence (no proper 'value', but a set of gdcm::SQItems, - composed of a set of gdc::DocEntry, recursively) - -- in a gdcm::DicomDir, we only deal, hierarchically, with : - - gdcmPatient - - gdcmStudy - - gdcmSerie - - gdcmImage +Example : + +old way : + DocEntry *p3 = item2->GetDocEntry(0x0018,0x0050); + if( !p3 ) return false; + ContentEntry *entry2 = dynamic_cast-You can see gdcm UML Class Diagram +(p3); + std::string thickness = entry2->GetValue(); + +new way : + DocEntry *p3 = item2->GetDocEntry(0x0018,0x0050); + if( !p3 ) return false; + DataEntry *entry2 = dynamic_cast (p3); + std::string thickness = entry2->GetString(); +
+ DataEntry *FileHelper::CopyDataEntry(uint16_t group, uint16_t elem); +-->DataEntry *FileHelper::CopyDataEntry(uint16_t group, uint16_t elem, + const VRKey &vr = GDCM_VRUNKNOWN); + + void FileHelper::CheckMandatoryEntry(uint16_t group, uint16_t elem, std::string value); +-->void FileHelper::CheckMandatoryEntry(uint16_t group, uint16_t elem, std::string value, + const VRKey &vr = GDCM_VRUNKNOWN); + + void FileHelper::SetMandatoryEntry(uint16_t group, uint16_t elem, std::string value); +-->void FileHelper::SetMandatoryEntry(uint16_t group, uint16_t elem, std::string value, + const VRKey &vr = GDCM_VRUNKNOWN); + + void FileHelper::CopyMandatoryEntry(uint16_t group, uint16_t elem, std::string value); +-->void FileHelper::CopyMandatoryEntry(uint16_t group, uint16_t elem, std::string value, + const VRKey &vr = GDCM_VRUNKNOWN); ++CopyMandatoryEntry(0x0002,0x0003,sop) +
+For multivaluated numeric DataEntries +-->void DataEntry::SetValue(const uint32_t &id,const double &val); +-->double DataEntry::GetValue(const uint32_t &id) const; +-->uint32_t DataEntry::GetValueCount() const; + +For converting 'Decimal String' +-->bool GetDSValue(std::vector <double> &valueVector); ++
+ gdcm::SerieHelper *sh= new gdcm::SerieHelper(); + // if user wants *not* to load some parts of the file headers + sh->SetLoadMode(loadMode); + + // if user wants *not* to load some files + sh->AddRestriction(group, element, value, operator); + sh->AddRestriction( ... + sh->SetDirectory(directoryWithImages); + + // if user *knows* how to order his files + sh->SetUserLessThanFunction(userSuppliedComparisonFunction); + // or/and + // if user wants to sort reverse order + sh->SetSortOrderToReverse(); + + // here, we suppose only the first 'Single SerieUID' Fileset is of interest + // Just iterate using sh->NextSingleSerieUIDFileSet() + // if you want to get all of them + gdcm::FileList *l = sh->GetFirstSingleSerieUIDFileSet(); + + // if user is doesn't trust too much the files with same Serie UID + if ( !sh->IsCoherent(l) ) + return; // not same sizes, or not same 'pixel type' -> stop + + sh->OrderFileList(l); // sort the list + + vtkGdcmReader *reader = vtkGdcmReader::New(); + // if user wants to modify pixel order (Mirror, TopDown, ...) + // he has to supply the function that does the job + // (a *very* simple example is given in vtkgdcmSerieViewer.cxx) + reader->SetUserFunction (userSuppliedFunction); + + // to pass a 'Single SerieUID' Fileset as produced by gdcm::SerieHelper + reader->SetCoherentFileList(l); + reader->Update(); ++ You can see a full example in vtk/vtkgdcmSerieViewer.cxx
+ gdcmSerieHelper *sh = new gdcmSerieHelper(); + sh->SetDirectory(myImageDirectory, true); + gdcmFileList *l = s->GetFirstCoherentFileList(); + s->OrderFileList(l); + + vtkGdcmReader *gr = new vtkGdcmReader(); + gr->SetCoherentFileList(l); + gr->Update(); ++ This works with a directory that contains only one 'Serie' + (same Serie UID for all the images).
+ gdcm::DicomDir *d = new gdcm::DicomDir(); + d->SetFileName(fileName); + d->Load( ); ++ + For parsing all the dicom files within a given root directory, use :
+ gdcm::DicomDir *d = new gdcm::DicomDir(); + d->SetDirectoryName(dirName); + d->Load( ) ++ + Don't use any longer old deprecated style:
+ gdcm::File *f = new gdcm::File(); + f->SetLoadMode(NO_SEQ); | depending on what + f->SetLoadMode(NO_SHADOW); | you want *not* + f->SetLoadMode(NO_SEQ | NO_SHADOW);| to load from the + f->SetLoadMode(NO_SHADOWSEQ); | target file + f->SetFileName(fileName); + f->Load( ); ++ Don't use any longer old deprecated style:
+ gdcm::DicomDir *f = new gdcm::DicomDir(); + f->SetLoadMode(NO_SEQ); | depending on what + f->SetLoadMode(NO_SHADOW); | you want *not* + f->SetLoadMode(NO_SEQ | NO_SHADOW);| to load from the files + f->SetLoadMode(NO_SHADOWSEQ); | within the root directory + f->SetDirectoryName(rootDirectoryName); + f->Load( ); ++ Don't use any longer old deprecated style: