From: regrain Date: Thu, 22 Jan 2004 18:26:50 +0000 (+0000) Subject: * Bug fix in demos because of method names changed X-Git-Tag: Version0.4~62 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;ds=sidebyside;h=bfa6045d992e657c5baef6badd290a975db35a31;p=gdcm.git * Bug fix in demos because of method names changed -- BeNours --- diff --git a/gdcmPython/demo/ReorganiseFiles.py b/gdcmPython/demo/ReorganiseFiles.py index 54fcb420..3db13f4d 100644 --- a/gdcmPython/demo/ReorganiseFiles.py +++ b/gdcmPython/demo/ReorganiseFiles.py @@ -30,7 +30,7 @@ SourceFiles=glob.glob(os.path.join(SourceDirectory, "*.dcm")) for file in SourceFiles: header = gdcmHeader(file) - info = header.GetPubEntry() + info = header.GetEntry() try: ImNum = info["Image Number"] if len(ImNum) == 0 or ImNum == "gdcm::Unfound": diff --git a/gdcmPython/demo/explore.py b/gdcmPython/demo/explore.py index c5b253f2..a72c79cd 100644 --- a/gdcmPython/demo/explore.py +++ b/gdcmPython/demo/explore.py @@ -11,7 +11,7 @@ if not os.path.isfile(FileName): sys.exit() toRead = gdcmHeader(FileName) -ValDict = toRead.GetPubEntry() +ValDict = toRead.GetEntry() ExploreElements = ["Patient's Name", "Patient ID", "Study Date", "Study Time", "Study ID", "Study Instance UID", @@ -24,4 +24,4 @@ for elem in ExploreElements: print "[%s]" % ValDict[elem] except KeyError: print "NOT FOUND" - + diff --git a/gdcmPython/demo/printGroupedPublicDict.py b/gdcmPython/demo/printGroupedPublicDict.py index 636119d4..fa03c30f 100644 --- a/gdcmPython/demo/printGroupedPublicDict.py +++ b/gdcmPython/demo/printGroupedPublicDict.py @@ -4,7 +4,7 @@ print "##############################################################" print "### Display all the possible tags of the current public" print "### dictionary" print "##############################################################" -PubList = GetPubDictTagNames() +PubList = GetPubDictEntryNames() for i in range(0, len(PubList)): print " ", PubList[i] @@ -14,7 +14,7 @@ print "### dictionary, but grouped by using the Fourth field" print "##############################################################" print " WARNING : the 'fourth' fiels IS NOT part of DICOM" print " DO NOT use it" -PubDict = GetPubDictTagNamesByCategory() +PubDict = GetPubDictEntryNamesByCategory() for fourth in PubDict: print " ############ Fourth group = ", fourth, " ##############" for key in PubDict[fourth]: diff --git a/gdcmPython/demo/testAll.py b/gdcmPython/demo/testAll.py index f67c2df7..f210f8db 100644 --- a/gdcmPython/demo/testAll.py +++ b/gdcmPython/demo/testAll.py @@ -33,6 +33,6 @@ if __name__ == '__main__': fileName = os.path.join(GDCM_TEST_DATA_PATH, file) print "############## file :", fileName toRead = gdcmHeader(fileName) - ValDict = toRead.GetPubEntry() + ValDict = toRead.GetEntry() for key in ValDict.keys(): print " [%s] = [%s]" %(key, ValDict[key]) diff --git a/gdcmPython/demo/vtkGdcmDemo.py b/gdcmPython/demo/vtkGdcmDemo.py index a6d14e4d..12802960 100644 --- a/gdcmPython/demo/vtkGdcmDemo.py +++ b/gdcmPython/demo/vtkGdcmDemo.py @@ -40,9 +40,9 @@ class vtkHistogram: self.ComputeHisto() self.__CumulHisto = [] histo = self.__Histo.GetOutput() - self.__CumulHisto.append(int(histo.GetScalarComponentAsFloat(0,0,0,0))) + self.__CumulHisto.append(int(histo.GetScalarComponentAsDouble(0,0,0,0))) for i in range(1, self.__NumberOfBins): - value = int(histo.GetScalarComponentAsFloat(i,0,0,0)) + value = int(histo.GetScalarComponentAsDouble(i,0,0,0)) self.__CumulHisto.append( self.__CumulHisto[i-1] + value) def GetTruncateLevels(self, LostPercentage): @@ -179,7 +179,7 @@ if not check.IsReadable(): print "The ", FileName, " file is not " print " readable with gdcm. Sorry." sys.exit() -check = check.GetPubEntry() +check = check.GetEntry() try: HighBit = check["High Bit"] if len(HighBit) == 0 or HighBit == "gdcm::Unfound":