X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/myo-class.git/blobdiff_plain/c67ab60de95008178e26817946990382751d91d8..d79fb355c92f240c7ad456199706cb76becea136:/topng.py diff --git a/topng.py b/topng.py index 9651446..c9b72d9 100644 --- a/topng.py +++ b/topng.py @@ -40,6 +40,9 @@ def getdir(filepath): return '/'.join(filepath.split('/')[:-1]) + '/' def topng(inputfile, outfile=None, overwrite=True): + """ + return (64, 64) : the width and height + """ try: dicimg = pydicom.read_file(inputfile) # read dicom image except pydicom.errors.InvalidDicomError as e: @@ -48,6 +51,7 @@ def topng(inputfile, outfile=None, overwrite=True): img = dicimg.pixel_array# get image array (12bits) # test << + # return img.shape # $$ COMMENT OR REMOVE THIS LINE print('img', img) # print('img', type(img)) # print('min', img.min(), 'max', img.max()) @@ -82,6 +86,8 @@ def topng(inputfile, outfile=None, overwrite=True): cv2.imwrite(savepath, img, [cv2.IMWRITE_PNG_COMPRESSION, 0]) # write png image + # test + return img.shape def topngs(inputdir, outdir): """