|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectwhistlesAndMoans.ConnectedRegion
public class ConnectedRegion
| Field Summary | |
|---|---|
private int |
channel
|
private SliceData |
currentSlice
|
private int |
firstSlice
|
private int[] |
freqRange
|
private boolean |
growing
|
private int |
maxPeaks
|
private int |
nJoinedEnd
After splitting of complex regions, these are Number of fragments connected to this at the start and at the end. |
private int |
nJoinedStart
After splitting of complex regions, these are Number of fragments connected to this at the start and at the end. |
private int[] |
peakFreqsBins
|
private int |
regionNumber
|
private java.util.List<SliceData> |
sliceData
|
private int |
sliceHeight
|
private int[] |
timesBins
list of time bins - there may be gaps in the whistle ! |
private int |
totalPixels
|
| Constructor Summary | |
|---|---|
ConnectedRegion(ConnectedRegion oldRegion,
SliceData oldSlice,
int peakNumber,
int nJoinedStart)
Constructor to create a new connected region during fragmentation. |
|
ConnectedRegion(int channel,
int firstSlice,
int regionNumber,
int height)
Constructor used during initial region detection process. |
|
| Method Summary | |
|---|---|
void |
addOfflineSlice(SliceData newSlice)
Add in a slice during offline mode. |
void |
addPixel(int iCol,
int iRow,
FFTDataUnit fftDataUnit)
|
private SliceData |
addSlice(int iSlice,
int sliceLen,
FFTDataUnit fftDataUnit)
|
private void |
addSlicePeak(SliceData oldSlice,
int peakNumber)
Extend a region during fragmentation |
protected void |
breakShortBridges()
Break short bridges in time. |
double |
calculateRMSAmplitude()
|
boolean |
checkRepeatslices()
Check for slices repeating twice. |
void |
cleanFragmentedFragment()
similar to condenseInfo, but for refragmetned fragments. |
void |
condenseInfo()
Go through the data and remove create triplets of into about each part of each slice in the region. |
void |
extendRegion(SliceData oldSlice,
int peakNumber)
Extend a region during fragmentation taking a single peak from a new slice. |
private void |
fillHoles(SliceData slice,
int maxHeight,
int nHoles)
Fill in small holes in the slice. |
protected void |
fillSmallHoles()
|
protected void |
fillSmallHoles(int maxHeight,
int maxWidth)
Fill small holes in the regions which will mess up later fragmentation |
private SliceData |
findSlice(int iSlice)
|
int |
getChannel()
|
long |
getDuration()
|
double |
getEndGradient(int nBins)
Gradient at the end of the shape for the first peak in pixels per pixel. |
int |
getFirstSlice()
|
SliceData |
getFirstSliceData()
|
int[] |
getFreqRange()
|
SliceData |
getLastSliceData()
|
int |
getMaxPeaks()
|
int |
getNJoinedEnd()
|
int |
getNJoinedStart()
|
int |
getNumSlices()
|
int[] |
getPeakFreqsBins()
|
int |
getRegionNumber()
|
java.util.List<SliceData> |
getSliceData()
|
int |
getSliceHeight()
|
double |
getStartGradient(int nBins)
Gradient at the start of the shape for the first peak in pixels per pixel. |
long |
getStartMillis()
|
long |
getStartSample()
|
int[] |
getTimesBins()
|
int |
getTotalPixels()
|
boolean |
isCross(int maxCrossLength)
|
boolean |
isGrowing()
|
boolean |
isMerge(int maxCrossLength)
|
boolean |
isRightMess()
|
boolean |
isSplit(int maxCrossLength)
|
void |
mergeFragmentedRegion(ConnectedRegion r2)
for merging two regions during the fragmentation process. |
void |
mergeRegion(ConnectedRegion region)
Merge another region into this region and then tell the array of regions that all references to that other region now refer to this one. |
void |
recycle()
|
void |
resetRegion(int channel,
int firstSlice,
int regionNumber,
int height)
Prepare a region for re-use (saves some time reallocating the object if they were only used very briefly). |
void |
sayRegion()
|
void |
setGrowing(boolean growing)
|
void |
setNJoinedEnd(int nJoinedEnd)
|
void |
setNJoinedStart(int nJoinedStart)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private int channel
private int regionNumber
private int firstSlice
private SliceData currentSlice
private int sliceHeight
private java.util.List<SliceData> sliceData
private int totalPixels
private boolean growing
private int[] freqRange
private int[] peakFreqsBins
private int[] timesBins
private int maxPeaks
private int nJoinedStart
private int nJoinedEnd
| Constructor Detail |
|---|
public ConnectedRegion(int channel,
int firstSlice,
int regionNumber,
int height)
channel - channel numberfirstSlice - first slice numberregionNumber - region numberheight - fft length
public ConnectedRegion(ConnectedRegion oldRegion,
SliceData oldSlice,
int peakNumber,
int nJoinedStart)
oldRegion - old mother region which is being fragmentedsliceData - start slice in the old regionpeakNumber - peak number in the slicenJoinedStart - number of contours that joined this one before the were fragmented.| Method Detail |
|---|
public void extendRegion(SliceData oldSlice,
int peakNumber)
oldSlice - reference to slice in old unitpeakNumber - number of peak to copypublic void addOfflineSlice(SliceData newSlice)
i - slice number (or slice index as it's read back !peakInfo - public boolean checkRepeatslices()
private void addSlicePeak(SliceData oldSlice,
int peakNumber)
oldSlice - old slicepeakNumber - peak to steal.
public void resetRegion(int channel,
int firstSlice,
int regionNumber,
int height)
channel - firstSlice - regionNumber - height -
public void addPixel(int iCol,
int iRow,
FFTDataUnit fftDataUnit)
private SliceData addSlice(int iSlice,
int sliceLen,
FFTDataUnit fftDataUnit)
private SliceData findSlice(int iSlice)
protected void fillSmallHoles(int maxHeight,
int maxWidth)
maxHeight - max height of hole in pixelsmaxWidth - max width of hole in pixels
private void fillHoles(SliceData slice,
int maxHeight,
int nHoles)
slice - slice to fillmaxHeight - max hole height.public void mergeRegion(ConnectedRegion region)
region - other regionregionArray - array of region references to update.public void mergeFragmentedRegion(ConnectedRegion r2)
r2 - public void recycle()
public void condenseInfo()
public void cleanFragmentedFragment()
protected void breakShortBridges()
protected void fillSmallHoles()
public boolean isGrowing()
public void setGrowing(boolean growing)
public int getChannel()
public int getRegionNumber()
public int getFirstSlice()
public int getSliceHeight()
public java.util.List<SliceData> getSliceData()
public int getNumSlices()
public int getTotalPixels()
public long getStartMillis()
public long getDuration()
public long getStartSample()
public void sayRegion()
public double calculateRMSAmplitude()
public int[] getFreqRange()
public int getMaxPeaks()
public int[] getPeakFreqsBins()
public int[] getTimesBins()
public SliceData getFirstSliceData()
public SliceData getLastSliceData()
public void setNJoinedStart(int nJoinedStart)
nJoinedStart - the nJoinedStart to setpublic int getNJoinedStart()
public void setNJoinedEnd(int nJoinedEnd)
nJoinedEnd - the nJoinedEnd to setpublic int getNJoinedEnd()
public double getStartGradient(int nBins)
nBins - number of bins to measure over.
public double getEndGradient(int nBins)
nBins - number of bins to measure over.
public boolean isCross(int maxCrossLength)
public boolean isMerge(int maxCrossLength)
public boolean isSplit(int maxCrossLength)
public boolean isRightMess()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||