public class VesselBranch
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected int |
availDOF |
protected float |
avgRad |
byte[][][] |
BGimage |
protected int[] |
children |
boolean |
contrastWasUsed |
float[][] |
fittedBifurCenterlinePts_mm |
boolean[][][] |
imgMask |
protected float |
length |
protected int |
level |
int |
maxNNodes |
int |
maxPts |
protected float |
mmPerPixelXY |
protected float |
mmPerPixelZ |
protected int |
myIndex |
protected int |
NangleSteps |
protected int |
nChildren |
protected int |
NinterPts |
int |
nnodes |
float[][] |
Nodes |
protected int |
nPhiPts |
int |
npts |
int |
nsmpts |
int |
nSmPtsPerElement |
protected int |
parClipEndPtIndex |
protected int |
parentIndex |
protected float |
parThetaOffset |
Point3Dint[] |
pts |
float |
relativeWallBrightness |
float |
relativeWallThickness |
Rectangle3D |
Roi |
protected int |
selfClipEndPtIndex |
protected int |
selfClipFrontPtIndex |
float[][] |
smoothPts |
float[][][] |
SurfPts |
protected float |
taper |
protected float[][][] |
tmpSurfPts |
protected float |
tortuosity |
boolean |
wasTraversed |
Constructor and Description |
---|
VesselBranch() |
VesselBranch(int brat,
int par,
int lev,
float mmPPxy,
float mmPPz) |
VesselBranch(int thisIndex,
VesselBranch A) |
Modifier and Type | Method and Description |
---|---|
void |
addChild(int index) |
void |
addPt(int x,
int y,
int z,
float radius) |
void |
addPt(Point3Dint A) |
float |
calcAvgRadius() |
float |
calcAvgRadius(int skip) |
float |
calcAvgRadius(int skip,
int totpts) |
void |
calcRoiAndMask(int depth,
int width,
int height,
VesselBranch parentBr)
Intent is to create a mask the contains the region around a given branch node over which
to compute the correlation (NCCC) to the original image, for optimizing the branch radius.
|
void |
clear() |
void |
computeNodes()
fit a smooth curve through the centerline points
|
float[] |
computeSeriesPtTangent(float[][] A,
int ptat)
WO 9/3/2015 compute tangent to the the array of points passed in, in mm
Intended for tangent for smoothPts, but generalized also for fitted bifurcation pts.
|
void |
computeSmoothPts(float[] parentBrLastNode)
Fit a smooth curve through the centerline points.
|
float |
computeSmoothPtsLen() |
float[] |
computeSmoothPtTangent(int smp)
compute tangent to the smoothPts, in mm
|
void |
CopyAll(VesselBranch A) |
void |
CopyPts(VesselBranch A) |
int |
createBifurcationMesh(VesselBranch parentBr)
goal to create the surface mesh that interpolates from the parent to this child.
|
byte[][][] |
createElemSimImage(byte[][][] simImg,
int elemAt,
float radiusAt,
float taperAt,
Rectangle3D curRoi,
VesselBranch parentBr,
boolean withContrast) |
byte[][][] |
createElemSimImage(byte[][][] simImg,
int elemAt,
float radiusAt,
Rectangle3D curRoi,
VesselBranch parentBr) |
byte[][][] |
createElemSimImage(byte[][][] simImg,
int elemAt,
Rectangle3D curRoi,
VesselBranch parentBr)
WO 3/18/2013 intent is to create an image from the current vessel info for use later as a template
to match for the vessel tree.
|
byte[][][] |
createElemSimImage(byte[][][] simImg,
int elemAt,
Rectangle3D curRoi,
VesselBranch parentBr,
boolean withContrast) |
byte[][][] |
createIsotropicSimImage(byte[][][] isoSimImg,
float radiusAt,
VesselBranch parentBr) |
byte[][][] |
createIsotropicSimImage(byte[][][] isoSimImg,
float radiusAt,
VesselBranch parentBr,
boolean withContrast) |
byte[][][] |
createIsotropicSimImage(byte[][][] isoSimImg,
VesselBranch parentBr)
goal is to create a sim image that can be used to generate a 3D physical model via a 3D printer of the vessel tree.
|
byte[][][] |
createSimImage(byte[][][] simImg,
boolean doAsSubImg,
int smPtStart,
int smPtEnd,
float radiusAt,
float taperAt,
Rectangle3D roi,
VesselBranch parentBr,
boolean withContrast,
boolean fitEnds)
intent is to use the branch smoothed centerline (in pixel units) and passed in radius (in mm) to create a
simulated image, based on the known voxel dimensions.
|
byte[][][] |
createSimImage(byte[][][] simImg,
float radiusAt,
float taperAt,
Rectangle3D roi,
VesselBranch parentBr) |
byte[][][] |
createSimImage(byte[][][] simImg,
float radiusAt,
float taperAt,
Rectangle3D roi,
VesselBranch parentBr,
boolean withContrast) |
byte[][][] |
createSimImage(byte[][][] simImg,
float radiusAt,
float taperAt,
VesselBranch parentBr) |
byte[][][] |
createSimImage(byte[][][] simImg,
float radiusAt,
float taperAt,
VesselBranch parentBr,
boolean withContrast) |
byte[][][] |
createSimImage(byte[][][] simImg,
float radiusAt,
Rectangle3D roi,
VesselBranch parentBr,
boolean withContrast) |
byte[][][] |
createSimImage(byte[][][] simImg,
float radiusAt,
Rectangle3D roi,
VesselBranch parentBr,
boolean withContrast,
boolean fitEnds) |
byte[][][] |
createSimImage(byte[][][] simImg,
int smPtStart,
int smPtEnd,
float radiusAt,
float taperAt,
Rectangle3D roi,
VesselBranch parentBr,
boolean withContrast) |
byte[][][] |
createSimImage(byte[][][] simImg,
int smPtStart,
int smPtEnd,
float radiusAt,
float taperAt,
VesselBranch parentBr) |
byte[][][] |
createSimImage(byte[][][] simImg,
int smPtStart,
int smPtEnd,
float radiusAt,
float taperAt,
VesselBranch parentBr,
boolean withContrast) |
byte[][][] |
createSimImage(byte[][][] simImg,
int smPtStart,
int smPtEnd,
VesselBranch parentBr)
This relies on the smoothPts and the avgRadius to create a simulated image, up to and including smPtEnd
|
byte[][][] |
createSimImage(byte[][][] simImg,
int smPtStart,
int smPtEnd,
VesselBranch parentBr,
boolean withContrast)
This relies on the smoothPts and the avgRadius to create a simulated image, up to and including smPtEnd
|
byte[][][] |
createSimImage(byte[][][] simImg,
Rectangle3D roi,
VesselBranch parentBr) |
byte[][][] |
createSimImage(byte[][][] simImg,
Rectangle3D roi,
VesselBranch parentBr,
boolean withContrast) |
byte[][][] |
createSimImage(byte[][][] simImg,
VesselBranch parentBr) |
byte[][][] |
createSimImage(byte[][][] simImg,
VesselBranch parentBr,
boolean withContrast) |
byte[][][] |
createSimImage(float radiusAt,
float taperAt,
Rectangle3D roi,
VesselBranch parentBr) |
byte[][][] |
createSimImage(float radiusAt,
float taperAt,
Rectangle3D roi,
VesselBranch parentBr,
boolean withContrast) |
byte[][][] |
createSimImage(int depth,
int width,
int height,
float radiusAt,
float taperAt,
VesselBranch parentBr) |
byte[][][] |
createSimImage(int depth,
int width,
int height,
float radiusAt,
float taperAt,
VesselBranch parentBr,
boolean withContrast) |
byte[][][] |
createSimImage(int depth,
int width,
int height,
VesselBranch parentBr)
intent is to use the branch smoothed centerline and passed in radius to create a simulated image, based on
the known voxel dimensions.
|
byte[][][] |
createSimImage(int depth,
int width,
int height,
VesselBranch parentBr,
boolean withContrast) |
byte[][][] |
createSimImage(Rectangle3D roi,
VesselBranch parentBr) |
byte[][][] |
createSimImage(Rectangle3D roi,
VesselBranch parentBr,
boolean withContrast) |
java.lang.String |
createSTL()
goal is to create an stl file to be used for CAD and 3D printing of the vessel tree.
|
java.lang.String |
createSTL(VesselBranch parentBr) |
float[][][] |
createSurfMesh()
goal is to create an surface mesh of the fitted tubular structure to help with stl file and simulated CT.
|
float[][][] |
createSurfMesh(VesselBranch parentBr) |
void |
deleteAllChildrenFromList() |
void |
deleteChildFromList(int chindex) |
void |
deleteFirstPt() |
void |
deleteLastPt() |
void |
Draw(ArrayDisplay ad) |
void |
Draw(ArrayDisplay ad,
boolean drawAsRadius) |
void |
Draw(ArrayDisplay ad,
boolean drawAsRadius,
int colorIndex) |
void |
extend(int extension) |
float |
getBendingAngle(int ptat) |
float[][] |
getBifurcationCenterline(VesselBranch parentBr)
goal to create the surface mesh that interpolates from the parent to this child.
|
int[] |
getChildrenIndices() |
float[] |
getEndVector() |
float[] |
getEndVector(int skip)
want unit vector[mm] pointing outward (toward children) from last point in branch that
best fits through the last NvecPts(global, =5), for computing bifurcation angle.
|
Point3Dint |
getFirstPoint() |
float[] |
getFrontVector() |
float[] |
getFrontVector(int skip)
gives unit vector pointing distally down current branch from first point in branch that
best fits through the first NvecPts(global, =5).
|
int |
getIndex() |
Point3Dint |
getLastPoint() |
float |
getLength_pixels() |
float |
getLength() |
int |
getLevel() |
Point3Dint |
getMiddlePoint() |
int |
getNendSkipPts(float childRad) |
int |
getNfrontSkipPts(float parRad) |
byte[][][] |
getNodeSimImage(int nodeAt,
float radiusAt,
float taperAt,
Rectangle3D curRoi,
VesselBranch parentBr,
boolean withContrast) |
byte[][][] |
getNodeSimImage(int nodeAt,
float radiusAt,
Rectangle3D curRoi,
VesselBranch parentBr) |
byte[][][] |
getNodeSimImage(int nodeAt,
Rectangle3D curRoi,
VesselBranch parentBr) |
byte[][][] |
getNodeSimImage(int nodeAt,
Rectangle3D curRoi,
VesselBranch parentBr,
boolean withContrast) |
int |
getParentIndex() |
Point3Dint |
getPoint(int ptat) |
float |
getPtSep(int brPtAt,
int nextPtAt) |
float |
getPtSep(int brPtAt,
Point3Dint nextPt) |
float[][] |
getSmoothPts(float[] parentBrLastNode) |
Rectangle3D |
getSmoothPtsBoundingBox(float currad) |
float[][][] |
getSurfMesh() |
float[] |
getTangent(int ptat) |
float |
getTortuosity() |
float |
getVolume() |
boolean |
hasChildren() |
boolean |
isPointInBranch(Point3Dint testPt) |
void |
listChildren() |
java.lang.String |
listPoints() |
java.lang.String |
printNodalParams()
intended to printout to file the fitted nodal values and radius that describes the model of the branch
|
boolean |
readNodalParams(java.io.BufferedReader r)
intended to read in the lines of code (created above) from the openned file r and set the branch params to match
|
float |
retrieveAvgRadius() |
void |
reversePoints() |
void |
setBGSimImage(byte[][][] simbg) |
void |
setLevel(int curlevel) |
void |
setParentIndex(int newParent) |
void |
shiftInZ(int zshift) |
java.lang.String |
toString() |
protected int myIndex
protected int parentIndex
protected int nChildren
protected int[] children
public boolean wasTraversed
public Point3Dint[] pts
public int npts
public int maxPts
protected int level
protected float avgRad
protected float length
protected float tortuosity
protected float mmPerPixelXY
protected float mmPerPixelZ
protected float taper
public int nnodes
public int maxNNodes
protected int availDOF
public float[][] Nodes
public int nsmpts
public int nSmPtsPerElement
public float[][] smoothPts
public float[][] fittedBifurCenterlinePts_mm
protected int parClipEndPtIndex
protected int selfClipFrontPtIndex
protected int selfClipEndPtIndex
protected float[][][] tmpSurfPts
protected float parThetaOffset
protected int NinterPts
protected int NangleSteps
protected int nPhiPts
public Rectangle3D Roi
public byte[][][] BGimage
public boolean[][][] imgMask
public float[][][] SurfPts
public boolean contrastWasUsed
public float relativeWallThickness
public float relativeWallBrightness
public VesselBranch()
public VesselBranch(int brat, int par, int lev, float mmPPxy, float mmPPz)
public VesselBranch(int thisIndex, VesselBranch A)
public void clear()
public void CopyAll(VesselBranch A)
public void CopyPts(VesselBranch A)
public void addPt(int x, int y, int z, float radius)
public void addPt(Point3Dint A)
public void extend(int extension)
public void deleteLastPt()
public void deleteFirstPt()
public Point3Dint getFirstPoint()
public Point3Dint getPoint(int ptat)
public Point3Dint getMiddlePoint()
public Point3Dint getLastPoint()
public void reversePoints()
public boolean isPointInBranch(Point3Dint testPt)
public int getLevel()
public void setLevel(int curlevel)
public int getIndex()
public int getParentIndex()
public void setParentIndex(int newParent)
public boolean hasChildren()
public int[] getChildrenIndices()
public void listChildren()
public void addChild(int index)
public void deleteChildFromList(int chindex)
public void deleteAllChildrenFromList()
public int getNfrontSkipPts(float parRad)
public int getNendSkipPts(float childRad)
public float calcAvgRadius()
public float calcAvgRadius(int skip)
public float calcAvgRadius(int skip, int totpts)
int
- skipfront, totpts where if (skip_totpts) < npts, then it omits pts at the end alsopublic float retrieveAvgRadius()
public float getLength()
public float getLength_pixels()
public float getPtSep(int brPtAt, int nextPtAt)
public float getPtSep(int brPtAt, Point3Dint nextPt)
public float getVolume()
public float getTortuosity()
public float[] getTangent(int ptat)
public float getBendingAngle(int ptat)
public float[] getFrontVector()
public float[] getFrontVector(int skip)
skip
- how many initial points to skip before starting to compute vector (default=0)public float[] getEndVector()
public float[] getEndVector(int skip)
skip
- how many initial points to skip before starting to compute vector (default=0)public void computeNodes()
public float[] computeSmoothPtTangent(int smp)
public float[] computeSeriesPtTangent(float[][] A, int ptat)
public void computeSmoothPts(float[] parentBrLastNode)
parentBrlastNode
- (==parentBr.Nodes[parentBr.nnodes-1])
if npts==1 then use trajectory to parent's last point to generate 2 smooth points.public float[][] getSmoothPts(float[] parentBrLastNode)
public float computeSmoothPtsLen()
public Rectangle3D getSmoothPtsBoundingBox(float currad)
public void Draw(ArrayDisplay ad)
public void Draw(ArrayDisplay ad, boolean drawAsRadius)
public void Draw(ArrayDisplay ad, boolean drawAsRadius, int colorIndex)
public byte[][][] createElemSimImage(byte[][][] simImg, int elemAt, Rectangle3D curRoi, VesselBranch parentBr)
simImg
- informs of image size, but also accumalates values over multiple calls.elemAt
- index of branch element, bounded by node with the same index, and the next node.(optional)
- radiusAt (default is current radius). Intent is to permit setting a later radius to generate
region of interest mask.boolean
- withContrast: flag for whether contrast was used in this image. If true sim image will include ring of lower
contrast material of radius increased by relativeWallThickness and pixel intensity relativeWallBrightness.public byte[][][] createElemSimImage(byte[][][] simImg, int elemAt, Rectangle3D curRoi, VesselBranch parentBr, boolean withContrast)
public byte[][][] createElemSimImage(byte[][][] simImg, int elemAt, float radiusAt, Rectangle3D curRoi, VesselBranch parentBr)
public byte[][][] createElemSimImage(byte[][][] simImg, int elemAt, float radiusAt, float taperAt, Rectangle3D curRoi, VesselBranch parentBr, boolean withContrast)
public byte[][][] getNodeSimImage(int nodeAt, Rectangle3D curRoi, VesselBranch parentBr)
public byte[][][] getNodeSimImage(int nodeAt, Rectangle3D curRoi, VesselBranch parentBr, boolean withContrast)
public byte[][][] getNodeSimImage(int nodeAt, float radiusAt, Rectangle3D curRoi, VesselBranch parentBr)
public byte[][][] getNodeSimImage(int nodeAt, float radiusAt, float taperAt, Rectangle3D curRoi, VesselBranch parentBr, boolean withContrast)
public byte[][][] createSimImage(int depth, int width, int height, VesselBranch parentBr)
int
- depth, width, height: dimensions of simulated image to be createdfloat
- radiusAt: (default is current branch radius)float
- taperAt: (dflt = taper) decrease in radius along length of branch as %difference (0..1.0) between end radii and
with the taper effect = 0 in the middle of the branch, thus front radius = radius- 0.5*taper.Rectangle3D
- roi: limits search and size of output simImage to this Roiboolean
- withContrast: flag for whether contrast was used in this image. If true sim image will include ring of lower
contrast material of radius increased by relativeWallThickness and pixel intensity relativeWallBrightness.boolean
- createEndCaps: flag to create a hemisphere (or hemi-disk in 2D) at the distal end of each branch. Turning this
Off to make mask of just the branch lumin and preserve the ends.public byte[][][] createSimImage(int depth, int width, int height, float radiusAt, float taperAt, VesselBranch parentBr)
public byte[][][] createSimImage(Rectangle3D roi, VesselBranch parentBr)
public byte[][][] createSimImage(float radiusAt, float taperAt, Rectangle3D roi, VesselBranch parentBr)
public byte[][][] createSimImage(byte[][][] simImg, VesselBranch parentBr)
public byte[][][] createSimImage(byte[][][] simImg, Rectangle3D roi, VesselBranch parentBr)
public byte[][][] createSimImage(byte[][][] simImg, int smPtStart, int smPtEnd, VesselBranch parentBr)
public byte[][][] createSimImage(byte[][][] simImg, float radiusAt, float taperAt, VesselBranch parentBr)
public byte[][][] createSimImage(byte[][][] simImg, float radiusAt, float taperAt, Rectangle3D roi, VesselBranch parentBr)
public byte[][][] createSimImage(byte[][][] simImg, int smPtStart, int smPtEnd, float radiusAt, float taperAt, VesselBranch parentBr)
public byte[][][] createSimImage(int depth, int width, int height, VesselBranch parentBr, boolean withContrast)
public byte[][][] createSimImage(int depth, int width, int height, float radiusAt, float taperAt, VesselBranch parentBr, boolean withContrast)
public byte[][][] createSimImage(Rectangle3D roi, VesselBranch parentBr, boolean withContrast)
public byte[][][] createSimImage(float radiusAt, float taperAt, Rectangle3D roi, VesselBranch parentBr, boolean withContrast)
public byte[][][] createSimImage(byte[][][] simImg, VesselBranch parentBr, boolean withContrast)
public byte[][][] createSimImage(byte[][][] simImg, Rectangle3D roi, VesselBranch parentBr, boolean withContrast)
public byte[][][] createSimImage(byte[][][] simImg, int smPtStart, int smPtEnd, VesselBranch parentBr, boolean withContrast)
public byte[][][] createSimImage(byte[][][] simImg, float radiusAt, float taperAt, VesselBranch parentBr, boolean withContrast)
public byte[][][] createSimImage(byte[][][] simImg, float radiusAt, float taperAt, Rectangle3D roi, VesselBranch parentBr, boolean withContrast)
public byte[][][] createSimImage(byte[][][] simImg, float radiusAt, Rectangle3D roi, VesselBranch parentBr, boolean withContrast)
public byte[][][] createSimImage(byte[][][] simImg, float radiusAt, Rectangle3D roi, VesselBranch parentBr, boolean withContrast, boolean fitEnds)
public byte[][][] createSimImage(byte[][][] simImg, int smPtStart, int smPtEnd, float radiusAt, float taperAt, VesselBranch parentBr, boolean withContrast)
public byte[][][] createSimImage(byte[][][] simImg, int smPtStart, int smPtEnd, float radiusAt, float taperAt, Rectangle3D roi, VesselBranch parentBr, boolean withContrast)
public byte[][][] createSimImage(byte[][][] simImg, boolean doAsSubImg, int smPtStart, int smPtEnd, float radiusAt, float taperAt, Rectangle3D roi, VesselBranch parentBr, boolean withContrast, boolean fitEnds)
byte[][][]
- simImg: cumulative simulated image to be created or added to.boolean
- doAsSubImg: flag indicating that the image to be created is a sub-image of a full image. If On then the coords
of all branch points will need to be shifted by roi.x, roi.y, roi.z to accomodate the sub-image coordinate system. The
dimensions of the roi must equal that of the passed-in sub-image.int
- smPtStart, smPtEnd: can limit ROI to section of branch defined the by smoothpoint. Used usually to limit to a node
for optimization of nodal parameters. (default is entire branch length). However, if doBifurModel==true then
will reset these to match the start and beginning of the fitted centerline region.float
- radiusAt[mm]: (default is current branch radius)float
- taperAt: (dflt = taper) decrease in radius along length of branch as %difference (0..1.0) between end radii and
with the taper effect = 0 in the middle of the branch, thus front radius = radius- 0.5*taper.Rectangle3D
- roi: limits search and size of output simImage to this Roi. If Roi == null, then will create one based
on the branch smooth points and current radiusboolean
- withContrast: flag for whether contrast was used in this image. If true sim image will include ring of lower
contrast material of radius increased by relativeWallThickness and pixel intensity relativeWallBrightness.boolean
- fitEnds: flag to create a smooth bifurcation model or a hemisphere (or hemi-disk in 2D) at the distal end of
each branch.
(not used) @param boolean highSampling: flag to use much finer smoothPts. When creating a simulated mesh want to have very high sampling along
the central axis, while for creating a surface mesh need only a coarse resolution (a point every 2 pixels).public byte[][][] createIsotropicSimImage(byte[][][] isoSimImg, VesselBranch parentBr)
simImg[][][]
- assume the dimensions dwh = those of the larger, isotropic imageradiusAt
- default=current radius. Give option to create an expanded radius version for mask creation.public byte[][][] createIsotropicSimImage(byte[][][] isoSimImg, float radiusAt, VesselBranch parentBr)
public byte[][][] createIsotropicSimImage(byte[][][] isoSimImg, float radiusAt, VesselBranch parentBr, boolean withContrast)
public float[][][] getSurfMesh()
public float[][][] createSurfMesh()
8/7/2014 3D printout fell apart. Need to solidly close up the connection between branches.
But biggest problem is/was that whereas I computed and printed to the STL output file the coords of the vector normal to
each surface triangle, some CAD programs (netfabb basic, and the 3D printer) ignore the passed-in normal vector and instead
compute the outward normal based on the order of the vertices. And I had not paid attension to the order hence about half
the time the order was incorrect so the normal pointed inwards. This is now fixed.
The bifurcation mesh to parent starts at parentbr.smoothPts[endPtIndex] and ends at (curbr)smoothPts[selfClipFrontIndex -1].
To improve connection between parent and child, define the theta of the child mesh points to match that of the parent. Also for
now making the nThetaSteps the same for all branches to avoid gaps at connections.
If this branch has children, then will create a bifurcation mesh to them, starting up from the end of the smoothPts array
at the index selfClipEndPtIndex that must = the 'parClipEndPtIndex' gotten when running the children's getBifurCenterline().
public float[][][] createSurfMesh(VesselBranch parentBr)
public float[][] getBifurcationCenterline(VesselBranch parentBr)
parentBr
- NangleSteps,
- nPhiPts, NinterPts all from the createSurfMesh()public int createBifurcationMesh(VesselBranch parentBr)
parentBr
- NangleSteps,
- nPhiPts, NinterPts all from the createSurfMesh()public java.lang.String createSTL()
public java.lang.String createSTL(VesselBranch parentBr)
public void calcRoiAndMask(int depth, int width, int height, VesselBranch parentBr)
public void setBGSimImage(byte[][][] simbg)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String listPoints()
public java.lang.String printNodalParams()
public boolean readNodalParams(java.io.BufferedReader r)
public void shiftInZ(int zshift)