Skip to content

Commit

Permalink
Merge branch 'BIO_ICT_olugins-have-optional-emptyImg-check-disable'
Browse files Browse the repository at this point in the history
  • Loading branch information
xulman committed Nov 22, 2023
2 parents d107a06 + 4593d06 commit 6bf4723
Showing 1 changed file with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,23 @@ public void setupSimilarAs(final TrackDataCache _referenceCache)
throw new NullPointerException("No existing (null) template/reference cache has been supplied.");

noOfDigits = _referenceCache.noOfDigits;
shouldComplainOnEmptyImages = _referenceCache.shouldComplainOnEmptyImages;
overlapRatio = _referenceCache.overlapRatio;
}

///specifies how many digits are to be expected in the input filenames
/** specifies how many digits are to be expected in the input filenames */
public int noOfDigits = 3;

/** specifies if the processing should stop when an input image with no segmentation/detection is found,
it's advisable to stop on empty images, the code may assume at places that there's always at least
one segmentation mask found in every image and definitively the code assumes that there's at least
one mask in a whole sequence (otherwise division by zero will occur) */
public boolean shouldComplainOnEmptyImages = true;

/** specifies what relative proportion of the area of a GT marker must be covered in order to declare a match,
it's advisable to avoid going below 0.5, the code may assume at places that overlapRatio >= 0.5 */
public double overlapRatio = 0.5;

///GT and RES paths combination for which this cache is valid, null means invalid
private String gtPath = null;
///GT and RES paths combination for which this cache is valid, null means invalid
Expand Down Expand Up @@ -522,14 +534,14 @@ public void ClassifyLabels(IterableInterval<UnsignedShortType> gt_img,
{
//default behavior is to be very strict:
// complain whenever empty result or GT image is found
ClassifyLabels(gt_img,res_img, true, levels.size(), 0.5);
ClassifyLabels(gt_img,res_img, shouldComplainOnEmptyImages, levels.size(), overlapRatio);
}

public void ClassifyLabels(IterableInterval<UnsignedShortType> gt_img,
RandomAccessibleInterval<UnsignedShortType> res_img,
final boolean shouldComplainOnEmptyImages)
{
ClassifyLabels(gt_img,res_img, shouldComplainOnEmptyImages, levels.size(), 0.5);
ClassifyLabels(gt_img,res_img, shouldComplainOnEmptyImages, levels.size(), overlapRatio);
}

public void ClassifyLabels(IterableInterval<UnsignedShortType> gt_img,
Expand All @@ -538,7 +550,7 @@ public void ClassifyLabels(IterableInterval<UnsignedShortType> gt_img,
{
//default behavior is to be very strict:
// complain whenever empty result or GT image is found
ClassifyLabels(gt_img,res_img, true, time, 0.5);
ClassifyLabels(gt_img,res_img, true, time, overlapRatio);
}

public void ClassifyLabels(IterableInterval<UnsignedShortType> gt_img,
Expand All @@ -548,7 +560,7 @@ public void ClassifyLabels(IterableInterval<UnsignedShortType> gt_img,
{
//default behavior is to be very strict:
// complain whenever empty result or GT image is found
ClassifyLabels(gt_img,res_img, shouldComplainOnEmptyImages, time, 0.5);
ClassifyLabels(gt_img,res_img, shouldComplainOnEmptyImages, time, overlapRatio);
}

@SuppressWarnings("unchecked")
Expand Down

0 comments on commit 6bf4723

Please sign in to comment.