}
Method = Dico_Method[method]

# Initialise time
ListTime = []

# Initialise list of templates (rather than opening them for every image iteration)
List_Template = [
    IJ.openImage(templ_file.getPath()) for templ_file in template_files
]

### Search ROI ? ###
# Check if there is a searchRoi
if roi_file:
    from ij.io import RoiDecoder
    searchRoi = RoiDecoder.open(roi_file.getPath())
else:
    searchRoi = None

# Check if it is a rectangular one
if searchRoi and searchRoi.getTypeAsString() == "Rectangle":
    Bool_SearchRoi = True
else:
    Bool_SearchRoi = False

# Define Offset for BBox if proper searchRoi
if Bool_SearchRoi:
    dX = searchRoi.getXBase()
    dY = searchRoi.getYBase()
else:
    dX = dY = 0
Example #2
0
        raise Exception('The expected number of object should be at least 1')

    if score_threshold < 0 or score_threshold > 1:
        raise Exception('The score threshold should be in range [0,1]')

    #if tolerance<0 or tolerance>1:
    #	raise Exception('Tolerance should be in range [0,1]')

    if max_overlap < 0 or max_overlap > 1:
        raise Exception('The max overlap should be in range [0,1]')

    ### Search ROI ? ###
    # Check if there is a searchRoi
    if RoiPath:
        from ij.io import RoiDecoder
        searchRoi = RoiDecoder.open(RoiPath)
    else:
        searchRoi = None

    # Check if it is a rectangular one
    if searchRoi and searchRoi.getTypeAsString() == "Rectangle":
        Bool_SearchRoi = True
        dX = int(searchRoi.getXBase())
        dY = int(searchRoi.getYBase())

    else:
        Bool_SearchRoi = False
        dX = dY = 0

    ## File or Folder
    # Template(s)