STRING_PREFILTER if prefilter else "", STRING_CBRECONSTRUCTION.format( recoMode=int(recoMode == "FDK"), fourierFilter=STRING_FOURIERFILTER if recoMode == "FDK" else "", setSize=numRuns*"20 ", numRuns=numRuns, mult=1 if recoMode == "MLEM" else 0, compute = 3 if prefilter else 2, tvGrad=tvGrad ), #STRING_LINEEXTRACTION.format( #fname=fpath, #compute = 4 if prefilter else 3), STRING_POSTFILTER if postfilter else "", STRING_EXPORTRAW.format( fname=fpath, compute = 3 if filMode == "no" else 4 ) ]) wsFileString = STRING_IWS_WRAPPING.format( algorithms=algorithms, phantomfile=PHANTOM_FILEPATH ) wsFilePath = "{}.iws".format(fpath) with open(wsFilePath, 'w') as wsFile: wsFile.write(wsFileString) print("Running workspace file, creating {} ...".format(wsFilePath)) call([EXECUTABLE, wsFilePath])
addPoissonNoise=int(noise), sdd=GEOMETRIES[GEOMETRY].sdd, spd=GEOMETRIES[GEOMETRY].spd ), #STRING_PREFILTER if prefilter else "", STRING_CBRECONSTRUCTION.format( recoMode=int(recoMode == "FDK"), fourierFilter=STRING_FOURIERFILTER if recoMode == "FDK" else "", setSize=numRuns*"20 ", numRuns=numRuns, mult=1 if recoMode == "MLEM" else 0, compute = 3 if prefilter else 2, tvGrad=tvGrad ), STRING_EXPORTRAW.format( fname=tmp_fpath, compute = 3 if filMode == 0 else 4 ) ]) wsFileString = STRING_IWS_WRAPPING.format( algorithms=algorithms, phantomfile=PHANTOM_FILEPATH ) wsFilePath = "{}.iws".format(fpath) with open(wsFilePath, 'w') as wsFile: wsFile.write(wsFileString) print("Running workspace file, creating {} ...".format(wsFilePath)) call([EXECUTABLE, wsFilePath])
STRING_CBRECONSTRUCTION.format( recoMode=int(recoMode == "FDK"), fourierFilter=STRING_FOURIERFILTER if recoMode == "FDK" else "", setSize=numRuns*"20 ", numRuns=numRuns, mult=1 if recoMode == "MLEM" else 0, compute = 3 if prefilter else 2, tvGrad=tvGrad ), #STRING_LINEEXTRACTION.format( #fname=fpath, #compute = 4 if prefilter else 3), STRING_POSTFILTER if postfilter else "", STRING_EXPORTRAW.format( fname=fpath, #compute = 5 if prefilter else # 4 if postfilter else 3 compute = 3 if filMode == "no" else 4 ) ]) wsFileString = STRING_IWS_WRAPPING.format( algorithms=algorithms, phantomfile=PHANTOM_FILE ) wsFilePath = "{}.iws".format(fpath) with open(wsFilePath, 'w') as wsFile: wsFile.write(wsFileString) print("Running workspace file, creating {} ...".format(wsFilePath))