Created
March 10, 2019 14:55
-
-
Save javathunderman/a3250eef2fa3d2f77cd79b576f34f053 to your computer and use it in GitHub Desktop.
Revisions
-
javathunderman created this gist
Mar 10, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ # Script for quickly converting DICOM images to ordered JPG images for machine learning. import os for fileName in os.listdir("."): noe = os.path.splitext(fileName)[0] if(noe == "convert"): continue os.system("convert " + fileName + " " + noe + ".jpg") os.remove(noe+".dcm") for fileName1 in os.listdir("."): noe1 = os.path.splitext(fileName1)[0] if(noe1 == "convert"): continue os.rename(fileName1, fileName1.replace(fileName1, noe1+"-whatever.jpg"))