org.shapelogic.imageprocessing
Class MaxDistanceVectorizer

java.lang.Object
  extended by org.shapelogic.imageprocessing.BaseVectorizer
      extended by org.shapelogic.imageprocessing.MaxDistanceVectorizer
All Implemented Interfaces:
ij.plugin.filter.PlugInFilter, IPixelTypeFinder, PixelJumperByte
Direct Known Subclasses:
MaxDistanceVectorizer_

public class MaxDistanceVectorizer
extends BaseVectorizer

Vectorizer that is splitting lines based on max distance to line between end points. The main idea is that this will read a whole multi line at a time. Then later it will split it according to max distance of pixels to the line between start and end point of the multi line. Maybe this could be completely abstracted out, maybe but at that point I will just take most of this class and turn it into a base class. Always stop on junctions, if there is one junction point use that, but stop after. N points are chosen last. Never go from one N point to another. If you are at a start point then just chose one direction. Can I delegate this to a different object. I always need to find all the neighbors first. I might have to know how many N points there are if there are more just add all to _unfinishedPoints. Treatment of different points: Junction: add to new point, move to first junction. N points: count, keep track of first. Other: count, keep track of first. Unused: count, keep track of first. I think that is already done. Used: count, keep track of first. For each junction add to unfinished. Go to first junction. If other points are available take first and go to it. If only N point is available, if current point an N stop else go to that. When coming to a new point check if it is a junction if stop if not on first point. It does not matter if the start point is used or not. I think that at the end check to see if you can go to either a junction point or to the start point.

Author:
Sami Badawi

Field Summary
protected  ChainCodeHandler _chainCodeHandler
           
 
Fields inherited from class org.shapelogic.imageprocessing.BaseVectorizer
_currentDirection, _currentPixelIndex, _currentPoint, _cyclePoints, _endPointsClusters, _errorMessage, _firstPointInLineIndex, _firstPointInMultiLine, _matchingOH, _maxX, _maxY, _minX, _minY, _numberOfPointsInAllLines, _pixels, _pixelTypeCalculator, _pixelTypeFinder, _rulesArrayForLetterMatching, _unfinishedPoints, MAX_DISTANCE_BETWEEN_CLUSTER_POINTS, POLYGON, RAW_POLYGON, STRAIGHT_LINE_COLOR
 
Fields inherited from interface ij.plugin.filter.PlugInFilter
CONVERT_TO_FLOAT, DOES_16, DOES_32, DOES_8C, DOES_8G, DOES_ALL, DOES_RGB, DOES_STACKS, DONE, FINAL_PROCESSING, NO_CHANGES, NO_IMAGE_REQUIRED, NO_UNDO, PARALLELIZE_STACKS, ROI_REQUIRED, SNAPSHOT, STACK_REQUIRED, SUPPORTS_MASKING
 
Constructor Summary
MaxDistanceVectorizer()
           
 
Method Summary
protected  void findMultiLine()
          Take point off _unfinishedPoints try to start line from that, if nothing is found the remove point
protected  void findMultiLinePostProcess()
          To be overridden.
protected  boolean findMultiLinePreProcess()
           
protected  boolean findNextLinePoint()
          Get the next point to investigate from _currentPoint This also contains check if this should cause a new new point to be created.
protected  byte handleProblematicPoints()
           
protected  void internalFactory()
          All the objects that needs special version should be created here.
protected  boolean lastPixelOk(byte newDirection)
          Everything is always OK.
 
Methods inherited from class org.shapelogic.imageprocessing.BaseVectorizer
addToUnfinishedPoints, countRegionCrossingsAroundPoint, drawLine, drawLines, findAllLines, findFirstLinePoint, findPointType, getCleanedupPolygon, getCyclePoints, getErrorMessage, getMatchingOH, getMaxX, getMaxY, getMinX, getMinY, getPixels, getPoints, getPolygon, init, isGuiEnabled, isPixelUsed, matchLines, moveCurrentPointForwards, oppesiteDirection, pixelIndexToPoint, pointToPixelIndex, pointToPixelIndex, polygonFactory, run, setup, showMessage, showMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_chainCodeHandler

protected ChainCodeHandler _chainCodeHandler
Constructor Detail

MaxDistanceVectorizer

public MaxDistanceVectorizer()
Method Detail

findMultiLine

protected void findMultiLine()
Take point off _unfinishedPoints try to start line from that, if nothing is found the remove point

Specified by:
findMultiLine in class BaseVectorizer

findNextLinePoint

protected boolean findNextLinePoint()
Get the next point to investigate from _currentPoint This also contains check if this should cause a new new point to be created. if there is more than one point to chose from add the point to: _unfinishedPoints that is a list of points that need to be revisited. assumes that _pixelTypeCalculator is set to current point

Returns:
true if there are more points

handleProblematicPoints

protected byte handleProblematicPoints()
Specified by:
handleProblematicPoints in class BaseVectorizer

lastPixelOk

protected boolean lastPixelOk(byte newDirection)
Everything is always OK. Stop only on junctions and end points.

Specified by:
lastPixelOk in class BaseVectorizer

internalFactory

protected void internalFactory()
Description copied from class: BaseVectorizer
All the objects that needs special version should be created here.

Specified by:
internalFactory in class BaseVectorizer

findMultiLinePreProcess

protected boolean findMultiLinePreProcess()
Overrides:
findMultiLinePreProcess in class BaseVectorizer

findMultiLinePostProcess

protected void findMultiLinePostProcess()
Description copied from class: BaseVectorizer
To be overridden. If I want to do more matching at the end.

Overrides:
findMultiLinePostProcess in class BaseVectorizer


Copyright © 2007. All Rights Reserved.