edu.jhu.tmaj.beans.masks.data
Class MaskUtil

java.lang.Object
  extended by edu.jhu.tmaj.beans.masks.data.MaskUtil

public final class MaskUtil
extends java.lang.Object

Contains utilties for handling mask arrays, which are representing as a boolean array where true values are said to be inside the mask, and false values are outside the mask.


Method Summary
static boolean[] getAllExclusiveMask(int pixelCount)
          Gets an all-exclusive mask of the supplied size
static boolean[] getAllInclusiveMask(int pixels)
          Gets a boolean[] mask where all elements are included.
static java.util.Map<java.lang.Boolean,java.lang.Integer> getMaskHisto(boolean[] mask)
           
static int getNumberOfLassoMasks(java.util.List<Mask> maskList)
           
static int[] getOnlyValuesInMask(int[] pixels, boolean[] mask)
          Returns an int array of pixels where only pixels inside the mask are included.
static int getSizeOfMask(boolean[] mask)
          Returns the number of pixels that are INSIDE the mask.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getSizeOfMask

public static int getSizeOfMask(boolean[] mask)
Returns the number of pixels that are INSIDE the mask.


getOnlyValuesInMask

public static int[] getOnlyValuesInMask(int[] pixels,
                                        boolean[] mask)
Returns an int array of pixels where only pixels inside the mask are included.


getAllInclusiveMask

public static boolean[] getAllInclusiveMask(int pixels)
Gets a boolean[] mask where all elements are included.


getAllExclusiveMask

public static boolean[] getAllExclusiveMask(int pixelCount)
Gets an all-exclusive mask of the supplied size


getNumberOfLassoMasks

public static int getNumberOfLassoMasks(java.util.List<Mask> maskList)

getMaskHisto

public static java.util.Map<java.lang.Boolean,java.lang.Integer> getMaskHisto(boolean[] mask)