public class VesselTree
extends java.lang.Object
VesselBranch
,
VesselSegm
Modifier and Type | Class and Description |
---|---|
class |
VesselTree.OptBrNodThread
This class is defined to run function OptBrNodes in //
WO 4/11/2012 All threads work with the same global origImg, but they only access this image and do not change it. |
class |
VesselTree.OptBrRadThread
This class is defined to run function OptBrRadius in //
WO 4/11/2012 This works by defining a unique Roi for each thread to work on. |
Modifier and Type | Field and Description |
---|---|
VesselBranch[] |
Branches |
protected boolean |
isByte |
byte[][][] |
isotropicSimTreeImg |
int |
Label |
protected int |
maskDepth |
protected int |
maskHeight |
protected int |
maskWidth |
int |
maxActiveBranchIndex |
protected float |
maxBrLength |
protected float |
maxBrRadius |
protected float |
maxBrTort |
protected int |
maxInitBranches |
float |
maxPathLength |
protected int |
minBranchLength |
protected float |
mmPerPixelXY |
protected float |
mmPerPixelZ |
int |
nBranches |
int |
nLevels |
int |
nLoopPts |
boolean |
OneMainBranch |
protected short[][][] |
origImg |
protected byte[][][] |
origImgByte |
byte[][][] |
simTreeImg |
boolean |
skelWasChanged |
protected boolean[][][] |
TreeMask |
int[] |
TreeTop |
protected boolean |
useTaper |
boolean |
withContrast |
Constructor and Description |
---|
VesselTree(float mmPPxy,
float mmPPz) |
VesselTree(int nbr,
float mmPPxy,
float mmPPz) |
VesselTree(int nbrLabel,
VesselTree A) |
Modifier and Type | Method and Description |
---|---|
void |
addBranch(int parentBr,
int suggestedLevel) |
void |
addBranchAndChildren(int parentBr,
VesselTree origVT,
int origIndexAt)
WO 11/20/2012 Add the branch from a separate vessel tree (OrigVT) with it's index
'origIndexAt' as a new child of this tree's branch parentBr, and its decendants recursively.
|
void |
adjustNodalParam(int brAt,
int nodeAt,
int paramAt,
float adjustBy)
change the nodal param and recompute the smooth points that the sim image is based on.
|
boolean |
branchExists(int br) |
void |
clear() |
Point3Dint |
clipBranchRadiusIncreases(int brAt,
float parRadRatioThresh,
float branchRadRatioThresh)
returns first break point along this branch
Intended to find fibrotic regions in lung volume hit during vessel traversal |
Point3Dint[] |
clipRadiusIncreases(float parRadRatioThresh,
float branchRadRatioThresh)
Found that parRadRatioThresh of 1.5 and radIncrRatio of 2 worked OK for 2D test data.
|
void |
Copy(VesselTree A) |
void |
createIsotropicSimImage(int depth,
int width,
int ht) |
void |
createIsotropicSimImage(int depth,
int width,
int ht,
float radiusExpansion) |
void |
createSimImage(int depth,
int width,
int ht) |
void |
createSimImage(int depth,
int width,
int ht,
float radiusExpansion) |
void |
createSimImage(int depth,
int width,
int ht,
float radiusExpansion,
boolean createEndCaps) |
void |
createSimImage(int depth,
int width,
int ht,
float radiusExpansion,
Rectangle3D roi) |
void |
createSimImage(int depth,
int width,
int ht,
float radiusExpansion,
Rectangle3D roi,
boolean createEndCaps) |
void |
createSimImage(int depth,
int width,
int ht,
Rectangle3D roi) |
java.lang.String |
createSTL()
goal is to create an stl file to be used for CAD and 3D printing of the vessel tree.
|
boolean |
deleteBranch_MergeSiblingToParent(int indexAt)
returns true if merged.
|
void |
deleteBranchAndChildren(int indexAt)
This deletes the branch with Branches array index 'indexAt' and its decendants recursively.
|
void |
Draw(ArrayDisplay ad) |
void |
Draw(ArrayDisplay ad,
boolean drawAsRadius) |
VesselTree |
Duplicate() |
void |
extend(int extension) |
int |
findFarthestFalseConnection()
Intent is to find children whose angle from each other is large (>110 degrees) AND
whose radius is larger than the parent.
|
int |
findFarthestFalseConnection(boolean exclude1BadLevel) |
void |
floodfillMaskFromTop()
12/24/2012 intent is for after adding diskOntoMask or after split tree into 2 sub-trees, then need to
regenerate the tree masks.
|
int[] |
getAncesterList(int brat)
7/8/2014 intent is to return a list of indices for the parent-ancesters of branch brat
|
int[] |
getBranchChildren(int parentIndex) |
boolean[][][] |
getBranchNodeROI(int brAt,
int nodeAt,
int depth,
int width,
int height)
Intent is to create a mask that contains the region of influence for a given branch node over which
to compute the correlation (NCCC) to the original image, for optimizing the nodal parameters.
|
byte[][][] |
getBranchNodeSimImage(int brAt,
int nodeAt,
Rectangle3D nodROI)
Intent is to create the similated vessel image only over the node of interest, over which
to compute the correlation (NCCC) to the original image, for optimizing the nodal parameters.
|
int |
getBranchWithStartLoc(int x,
int y,
int z) |
float[][][][] |
getFittedCenterlinePts_mm()
goal is to retrieve the fitted centerline points for all branches, including the bifurcation model from parent
to child, to look for errors (bending) in the centerline fits.
|
byte[][][] |
getIsotropicSimImage(int depth,
int width,
int ht) |
float |
getLargestBranchLength() |
float |
getLargestBranchRadius() |
float[][] |
getLengthHistogram(int nBins) |
int[] |
getLongestBranchPath()
9/2/2012 intent is to find the longest branch path, starting from the farthest branch and tracing
backwards via parents.
|
VesselBranch |
getMostRecentBranch() |
int |
getMostRecentIndex() |
int |
getNbranches() |
int |
getNbranchesAtLevel(int level) |
int |
getNlevels() |
float[][] |
getRadiusHistogram(int nBins) |
byte[][][] |
getSimImage(int depth,
int width,
int ht)
Compute the simImg if it doesn't exist already.
|
byte[][][] |
getSimImage(int depth,
int width,
int ht,
Rectangle3D roi) |
int |
getTopBranchIndex() |
float[][] |
getTortuosityHistogram(int nBins) |
boolean[][][] |
getTreeMask() |
int[] |
getTreeTop() |
Point3Dint |
getTreeTopPt3D() |
float |
getVolume()
compute vascular volume as sum_brs{br_len*br_area)
|
void |
insertDiskOntoMask(int brAt,
int insertPt) |
void |
insertDiskOntoMask(int brAt,
java.lang.String where)
12/24/2012 intent is to place a break int the mask to permit separation of mask into sub-tree masks.
|
void |
insertDiskOntoMask(Point3Dint loc) |
boolean |
isPointInTree(Point3Dint testPt) |
void |
OptBranchNode(int brAt,
int nodeAt,
int iterAt)
optimize over each node's 6 parameters X,Y,Z, DXDS, DYDS, DZDS driven by NCCC to the original image,
If at the first node and the branch has a parent then do not opt over the coord params because those are already being optimized when the parent's last node's coords are optimized. |
void |
OptBranchRadius(int brAt,
int iterAt)
optimize over the branch radius, driven by NCCC to the original image.
|
void |
OptBranchTaper(int brAt,
int iterAt)
optimize over the branch radius taper, driven by NCCC to the original image.
|
void |
OptNodes(int iterAt)
WO 4/16/2012 parallel version.
|
void |
OptRadii(int iter)
WO 4/11/2012 parallel version.
|
void |
OptToImage(byte[][][] targetImg)
4/34/2013 optimize over each branch params.
|
void |
OptToImage(short[][][] targetImg)
4/34/2013 optimize over each branch params.
|
boolean |
plugMaskAtPoint(int brAt,
int brPtIndex)
1/8/2012 intent is to void pixels in the mask image to block the mask at branch point brPtIndex.
|
java.lang.String |
PrintSimTreeParams() |
void |
printTreeHierarchy() |
boolean |
ReadSimTreeParams(java.lang.String path) |
void |
reCreateSimImage() |
void |
resetALevel(int parIndex,
int parLevel) |
void |
resetLevels() |
void |
setBrBGImages(int depth,
int width,
int height)
create background images.
|
void |
setTreeMask(boolean[][][] M) |
void |
shiftInZ(int zshift) |
void |
smoothTreeBranches()
4/2/2013 Intent is to create smooth fits to the branches for future simulated vessel calc.
|
java.lang.String |
toString() |
java.lang.String |
toString(boolean summaryOnly) |
void |
trimStubs() |
public VesselBranch[] Branches
public int nBranches
public int maxActiveBranchIndex
protected int maxInitBranches
protected int minBranchLength
public int Label
public int nLevels
public int[] TreeTop
public boolean skelWasChanged
public byte[][][] simTreeImg
public byte[][][] isotropicSimTreeImg
protected boolean[][][] TreeMask
protected int maskDepth
protected int maskWidth
protected int maskHeight
protected float mmPerPixelXY
protected float mmPerPixelZ
protected float maxBrRadius
protected float maxBrLength
protected float maxBrTort
public float maxPathLength
public boolean OneMainBranch
protected short[][][] origImg
protected byte[][][] origImgByte
protected boolean isByte
protected boolean useTaper
public boolean withContrast
public int nLoopPts
public VesselTree(float mmPPxy, float mmPPz)
public VesselTree(int nbr, float mmPPxy, float mmPPz)
public VesselTree(int nbrLabel, VesselTree A)
public void Copy(VesselTree A)
public VesselTree Duplicate()
public void clear()
public void addBranch(int parentBr, int suggestedLevel)
public boolean branchExists(int br)
public VesselBranch getMostRecentBranch()
public int getMostRecentIndex()
public int getTopBranchIndex()
public int getBranchWithStartLoc(int x, int y, int z)
public boolean deleteBranch_MergeSiblingToParent(int indexAt)
indexAt
- index to Branches[] of the child branch being deleted.public void deleteBranchAndChildren(int indexAt)
public void addBranchAndChildren(int parentBr, VesselTree origVT, int origIndexAt)
public void extend(int extension)
public float getVolume()
public int[] getTreeTop()
public Point3Dint getTreeTopPt3D()
public boolean isPointInTree(Point3Dint testPt)
public void resetLevels()
public void resetALevel(int parIndex, int parLevel)
public int getNlevels()
public int getNbranches()
public int getNbranchesAtLevel(int level)
public int[] getBranchChildren(int parentIndex)
public Point3Dint[] clipRadiusIncreases(float parRadRatioThresh, float branchRadRatioThresh)
public Point3Dint clipBranchRadiusIncreases(int brAt, float parRadRatioThresh, float branchRadRatioThresh)
brAt:
- index of branch in treeparRadRatioThresh:
- cut-off ratio of radii of distal portion of branch to parent. For vessel segmentation this is set in GUI.branchRadRatioThresh:
- cut-off ratio of radii distal vs. proximal portion of branch. For vessel segmentation this is set in GUI.public void trimStubs()
public boolean plugMaskAtPoint(int brAt, int brPtIndex)
public void insertDiskOntoMask(int brAt, java.lang.String where)
public void insertDiskOntoMask(Point3Dint loc)
public void insertDiskOntoMask(int brAt, int insertPt)
public void floodfillMaskFromTop()
public boolean[][][] getTreeMask()
public void setTreeMask(boolean[][][] M)
public void smoothTreeBranches()
public int findFarthestFalseConnection()
Will go through this function repeatedly until all false connections are covered.
boolean
- exclude1BadLevel [false] intended for when have already corrected all loops and are
looking to split tres. This excludes splitting if only 1 branch > parent, rather than 2 or more
in a row up the tree are bad. This is intended to give some robustness to noise, but fails if
you happen to be at one branch from the top of a falsely connected tree.public int findFarthestFalseConnection(boolean exclude1BadLevel)
public int[] getLongestBranchPath()
public int[] getAncesterList(int brat)
public float[][] getLengthHistogram(int nBins)
public float getLargestBranchLength()
public float getLargestBranchRadius()
public float[][] getRadiusHistogram(int nBins)
public float[][] getTortuosityHistogram(int nBins)
public void Draw(ArrayDisplay ad)
public void Draw(ArrayDisplay ad, boolean drawAsRadius)
public void reCreateSimImage()
public void createSimImage(int depth, int width, int ht)
public void createSimImage(int depth, int width, int ht, float radiusExpansion)
public void createSimImage(int depth, int width, int ht, float radiusExpansion, boolean createEndCaps)
public void createSimImage(int depth, int width, int ht, Rectangle3D roi)
public void createSimImage(int depth, int width, int ht, float radiusExpansion, Rectangle3D roi)
public void createSimImage(int depth, int width, int ht, float radiusExpansion, Rectangle3D roi, boolean createEndCaps)
public void createIsotropicSimImage(int depth, int width, int ht)
public void createIsotropicSimImage(int depth, int width, int ht, float radiusExpansion)
public byte[][][] getSimImage(int depth, int width, int ht)
public byte[][][] getSimImage(int depth, int width, int ht, Rectangle3D roi)
public byte[][][] getIsotropicSimImage(int depth, int width, int ht)
public byte[][][] getBranchNodeSimImage(int brAt, int nodeAt, Rectangle3D nodROI)
public boolean[][][] getBranchNodeROI(int brAt, int nodeAt, int depth, int width, int height)
public void adjustNodalParam(int brAt, int nodeAt, int paramAt, float adjustBy)
adjustBy
- in [pixels] if adjusting a coord parameter. Is unit-less for slopespublic void OptToImage(byte[][][] targetImg)
public void OptToImage(short[][][] targetImg)
public void setBrBGImages(int depth, int width, int height)
public void OptRadii(int iter)
public void OptNodes(int iterAt)
public void OptBranchRadius(int brAt, int iterAt)
public void OptBranchTaper(int brAt, int iterAt)
public void OptBranchNode(int brAt, int nodeAt, int iterAt)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(boolean summaryOnly)
public java.lang.String PrintSimTreeParams()
public boolean ReadSimTreeParams(java.lang.String path)
public float[][][][] getFittedCenterlinePts_mm()
public java.lang.String createSTL()
public void printTreeHierarchy()
public void shiftInZ(int zshift)