コード例 #1
0
def findHvalue(_rawImageFile="E:\workspace\jinyoung\CancerImageAnalyzer\img\BF_position020100_time0001.tif"):
    _outputPath = '/ppimg'+datetime.datetime.today().strftime('%y%m%d%H%M')+'/'
    rawImgFloat = cia.loadRawImage(_rawImageFile)
    filteredImg1st = cia.execGaussianFiltering(rawImgFloat)

    for hVal in np.arange(0.1,1.0,0.1):
        dilatedImg = cia.execMorphologicalDilation(filteredImg1st,h=hVal)
        cia.savePreprocessingImage(dilatedImg,outputPath=_outputPath,h=hVal)
コード例 #2
0
def findThresholdValue(_ppImageFile="E:\workspace\jinyoung\CancerImageAnalyzer\img\ppimg1601101615\BF_position020100_time0001hVal0.4.png"):
    _thOutputPath = '/thimg'+datetime.datetime.today().strftime('%y%m%d%H%M')+'/'
    ppImageFileName = os.path.basename(_ppImageFile)
    ppImageFilePath = os.path.dirname(_ppImageFile)

    biImageFilePath = ppImageFilePath + _thOutputPath

    ppImg = cia.loadRawImage(_ppImageFile)

    for thVal in np.arange(0.1,1.0,0.1):
        filledImg = cia.convertBinaryImage(ppImg,threshold=thVal)
        if not os.path.exists(biImageFilePath):
            os.mkdir(biImageFilePath)
        biImageFileName = ppImageFileName[:ppImageFileName.rfind('.')]+'thVal'+str(thVal)+'.png'
        imsave(biImageFilePath+biImageFileName, filledImg)