Package whistlesAndMoans
Class FragmentingFragmenter
java.lang.Object
whistlesAndMoans.DiscardingFragmenter
whistlesAndMoans.FragmentingFragmenter
- All Implemented Interfaces:
RegionFragmenter
- Direct Known Subclasses:
RejoiningFragmenter
-
Field Summary
FieldsFields inherited from class whistlesAndMoans.DiscardingFragmenter
maxPeaks, motherRegion, nFragments, nSlices, slicePeaks, totalPeaks -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidClean up fragments - mostly sorting out links between peaks.protected booleancloseRegion(ConnectedRegion region, int nJoinedEnd) Finish off a region if no more bits are to be added to it.voidSplit the mother region up into fragments, breaking at every branch and joinintfragmentRegion(ConnectedRegion connectedRegion) Fragment a connected regiongetFragment(int fragment) Get a specific fragmentintGet the number of fragmentsbooleanprotected booleanmatchPeak(int[] peak1, int[] peak2, int connectType) Match to peaks - return true if they merge into one another.protected voidsayFragment(int iFrag, ConnectedRegion region) Dump information on a single fragment ot screen.protected voidDump information to screen.voidsetDiscardSmallOnes(boolean discardSmallOnes) Set by teh RejoinFragments superclass so that all fragments are kept
-
Field Details
-
fragments
-
whistleMoanControl
-
-
Constructor Details
-
FragmentingFragmenter
-
-
Method Details
-
fragmentRegion
Description copied from interface:RegionFragmenterFragment a connected region- Specified by:
fragmentRegionin interfaceRegionFragmenter- Overrides:
fragmentRegionin classDiscardingFragmenter- Parameters:
connectedRegion- region to fragment- Returns:
- number of fragments.
-
createFragments
public void createFragments()Split the mother region up into fragments, breaking at every branch and join -
closeRegion
Finish off a region if no more bits are to be added to it.- Parameters:
region- region to closenJoinedEnd- number of other bits coming out of this point- Returns:
- true if the region is big enough to be worth keeping.
-
matchPeak
protected boolean matchPeak(int[] peak1, int[] peak2, int connectType) Match to peaks - return true if they merge into one another.- Parameters:
peak1- first peakpeak2- second peakconnectType- connect 4 or connect 8- Returns:
- true if they touch according to 4 / 8 rule
-
cleanFragments
protected void cleanFragments()Clean up fragments - mostly sorting out links between peaks. -
getFragment
Description copied from interface:RegionFragmenterGet a specific fragment- Specified by:
getFragmentin interfaceRegionFragmenter- Overrides:
getFragmentin classDiscardingFragmenter- Parameters:
fragment- fragment number (0 to getNumFragments);- Returns:
- the ith fragment
-
getNumFragments
public int getNumFragments()Description copied from interface:RegionFragmenterGet the number of fragments- Specified by:
getNumFragmentsin interfaceRegionFragmenter- Overrides:
getNumFragmentsin classDiscardingFragmenter- Returns:
- the number of fragments
-
isDiscardSmallOnes
public boolean isDiscardSmallOnes() -
setDiscardSmallOnes
public void setDiscardSmallOnes(boolean discardSmallOnes) Set by teh RejoinFragments superclass so that all fragments are kept- Parameters:
discardSmallOnes-
-
sayFragments
protected void sayFragments()Dump information to screen. -
sayFragment
Dump information on a single fragment ot screen.- Parameters:
iFrag-region-
-