task deepIHC{
    String deepIHC_taskPy
    String outpath
    String tmpResDir="tmpResult"
    Float nonZeroProp
    String judgePatch
    Float leftDis
    String slidePath
    
    String maskPath=outpath+"/"+"mask"
    String patchPath=outpath+"/"+"patch"
    String patchAbsPathLabelCSV=outpath+"/"+tmpResDir+"/"+"patch2tif.csv"
    String predictTmpResultCSV=outpath+"/"+tmpResDir+"/"+"predictTmpResult.csv"
    String wholeSlideInferDir=outpath+"/"+tmpResDir+"/"+"wsiInferResult"
    String tifPredClassCSV=outpath+"/"+tmpResDir+"/"+"getTifPredClass"+"/"+"tifPredClass.csv"
    String heatmapDir=outpath+"/"+"heatmap"
        
    command {
        source /home/jwang/miniconda3/bin/activate /home/jwang/miniconda3/envs/deepIHC2
        /home/jwang/miniconda3/envs/deepIHC2/bin/python3.6 ${deepIHC_taskPy} \
        --slidePath=${slidePath} \
        --maskPath=${maskPath} \
        --patchPath=${patchPath} \
        --nonZeroProp=${nonZeroProp} \
        --judgePatch=${judgePatch} \
        --patchAbsPathLabelCSV=${patchAbsPathLabelCSV} \
        --predictTmpResultCSV=${predictTmpResultCSV} \
        --wholeSlideInferDir=${wholeSlideInferDir} \
        --tifPredClassCSV=${tifPredClassCSV} \
        --heatmapDir=${heatmapDir} \
        --leftDis=${leftDis}
    }
    
}



workflow wf {
    String deepIHC_taskPy
    String slidePath
    #String maskPath
    #String patchPath
    String outpath
    Float nonZeroProp
    String judgePatch
    #String patchAbsPathLabelCSV
    #String predictTmpResultCSV
    #String wholeSlideInferDir
    #String tifPredClassCSV
    #String heatmapDir
    Float leftDis
    
    call deepIHC{
        input:
            deepIHC_taskPy=deepIHC_taskPy,
            slidePath=slidePath,
            #maskPath=maskPath,
            #patchPath=patchPath,
            outpath=outpath,
            nonZeroProp=nonZeroProp,
            judgePatch=judgePatch,
            #patchAbsPathLabelCSV=patchAbsPathLabelCSV,
            #predictTmpResultCSV=predictTmpResultCSV,
            #wholeSlideInferDir=wholeSlideInferDir,
            #tifPredClassCSV=tifPredClassCSV,
            #heatmapDir=heatmapDir,
            leftDis=leftDis
    }
}