Computes the shortest path from one border to its opposite, given distance ponderation map.
More...
| IPSDKIPLADVANCEDMORPHOLOGY_API ipsdk::imaproc::attr::RidgeLine3dResult | ipsdk::imaproc::advmorpho::ridgeLine3dImg (const ipsdk::image::ImageConstPtr &pInImg3d, const ipsdk::imaproc::attr::ePropagationAxis &pInPropagationAxis, const ipsdk::imaproc::attr::ePropagationDirection &pInPropagationDirection) |
| | wrapper function for Computes the shortest path from one border to its opposite, given distance ponderation map. More...
|
| |
| IPSDKIPLADVANCEDMORPHOLOGY_API ipsdk::imaproc::attr::RidgeLine3dResult | ipsdk::imaproc::advmorpho::ridgeLine3dImg (const ipsdk::image::ImageConstPtr &pInImg3d, const ipsdk::image::ImageConstPtr &pInOptMaskImg, const ipsdk::imaproc::attr::ePropagationAxis &pInPropagationAxis, const ipsdk::imaproc::attr::ePropagationDirection &pInPropagationDirection) |
| | wrapper function for Computes the shortest path from one border to its opposite, given distance ponderation map. More...
|
| |
| IPSDKIPLADVANCEDMORPHOLOGY_API ipsdk::imaproc::attr::Voxels3dPtr | ipsdk::imaproc::advmorpho::ridgeLine3dImg (const ipsdk::image::ImageConstPtr &pInImg3d, const ipsdk::imaproc::attr::ePropagationAxis &pInPropagationAxis, const ipsdk::imaproc::attr::ePropagationDirection &pInPropagationDirection, const ipsdk::image::ImagePtr &pOutShortestPathImg, const ipsdk::image::ImagePtr &pOutDistanceMap, const ipsdk::image::ImagePtr &pOutPathMap) |
| | wrapper function for Computes the shortest path from one border to its opposite, given distance ponderation map. More...
|
| |
| IPSDKIPLADVANCEDMORPHOLOGY_API ipsdk::imaproc::attr::RidgeLine3dResult | ipsdk::imaproc::advmorpho::ridgeLine3dImg (const ipsdk::image::ImageConstPtr &pInImg3d, const ipsdk::imaproc::attr::ePropagationAxis &pInPropagationAxis, const ipsdk::imaproc::attr::ePropagationDirection &pInPropagationDirection, const ipsdk::ipUInt32 nbIter) |
| | wrapper function for Computes the shortest path from one border to its opposite, given distance ponderation map. More...
|
| |
| IPSDKIPLADVANCEDMORPHOLOGY_API ipsdk::imaproc::attr::RidgeLine3dResult | ipsdk::imaproc::advmorpho::ridgeLine3dImg (const ipsdk::image::ImageConstPtr &pInImg3d, const ipsdk::image::ImageConstPtr &pInOptMaskImg, const ipsdk::imaproc::attr::ePropagationAxis &pInPropagationAxis, const ipsdk::imaproc::attr::ePropagationDirection &pInPropagationDirection, const ipsdk::ipUInt32 nbIter) |
| | wrapper function for Computes the shortest path from one border to its opposite, given distance ponderation map. More...
|
| |
| IPSDKIPLADVANCEDMORPHOLOGY_API ipsdk::imaproc::attr::Voxels3dPtr | ipsdk::imaproc::advmorpho::ridgeLine3dImg (const ipsdk::image::ImageConstPtr &pInImg3d, const ipsdk::image::ImageConstPtr &pInOptMaskImg, const ipsdk::imaproc::attr::ePropagationAxis &pInPropagationAxis, const ipsdk::imaproc::attr::ePropagationDirection &pInPropagationDirection, const ipsdk::image::ImagePtr &pOutShortestPathImg, const ipsdk::image::ImagePtr &pOutDistanceMap, const ipsdk::image::ImagePtr &pOutPathMap) |
| | wrapper function for Computes the shortest path from one border to its opposite, given distance ponderation map. More...
|
| |
| IPSDKIPLADVANCEDMORPHOLOGY_API ipsdk::imaproc::attr::Voxels3dPtr | ipsdk::imaproc::advmorpho::ridgeLine3dImg (const ipsdk::image::ImageConstPtr &pInImg3d, const ipsdk::imaproc::attr::ePropagationAxis &pInPropagationAxis, const ipsdk::imaproc::attr::ePropagationDirection &pInPropagationDirection, const ipsdk::ipUInt32 nbIter, const ipsdk::image::ImagePtr &pOutShortestPathImg, const ipsdk::image::ImagePtr &pOutDistanceMap, const ipsdk::image::ImagePtr &pOutPathMap) |
| | wrapper function for Computes the shortest path from one border to its opposite, given distance ponderation map. More...
|
| |
| IPSDKIPLADVANCEDMORPHOLOGY_API ipsdk::imaproc::attr::Voxels3dPtr | ipsdk::imaproc::advmorpho::ridgeLine3dImg (const ipsdk::image::ImageConstPtr &pInImg3d, const ipsdk::image::ImageConstPtr &pInOptMaskImg, const ipsdk::imaproc::attr::ePropagationAxis &pInPropagationAxis, const ipsdk::imaproc::attr::ePropagationDirection &pInPropagationDirection, const ipsdk::ipUInt32 nbIter, const ipsdk::image::ImagePtr &pOutShortestPathImg, const ipsdk::image::ImagePtr &pOutDistanceMap, const ipsdk::image::ImagePtr &pOutPathMap) |
| | wrapper function for Computes the shortest path from one border to its opposite, given distance ponderation map. More...
|
| |
| IPSDKIPLADVANCEDMORPHOLOGY_API ipsdk::imaproc::attr::PlanIndexedVoxels3dPtr | ipsdk::imaproc::advmorpho::ridgeLine3dImg_multiSlice (const ipsdk::image::ImageConstPtr &pInImg3d, const ipsdk::imaproc::attr::ePropagationAxis &pInPropagationAxis, const ipsdk::imaproc::attr::ePropagationDirection &pInPropagationDirection, const ipsdk::image::ImagePtr &pOutShortestPathImg, const ipsdk::image::ImagePtr &pOutDistanceMap, const ipsdk::image::ImagePtr &pOutPathMap) |
| | wrapper function for Computes the shortest path from one border to its opposite, given distance ponderation map. More...
|
| |
| IPSDKIPLADVANCEDMORPHOLOGY_API ipsdk::imaproc::attr::PlanIndexedVoxels3dPtr | ipsdk::imaproc::advmorpho::ridgeLine3dImg_multiSlice (const ipsdk::image::ImageConstPtr &pInImg3d, const ipsdk::image::ImageConstPtr &pInOptMaskImg, const ipsdk::imaproc::attr::ePropagationAxis &pInPropagationAxis, const ipsdk::imaproc::attr::ePropagationDirection &pInPropagationDirection, const ipsdk::image::ImagePtr &pOutShortestPathImg, const ipsdk::image::ImagePtr &pOutDistanceMap, const ipsdk::image::ImagePtr &pOutPathMap) |
| | wrapper function for Computes the shortest path from one border to its opposite, given distance ponderation map. More...
|
| |
| IPSDKIPLADVANCEDMORPHOLOGY_API ipsdk::imaproc::attr::PlanIndexedVoxels3dPtr | ipsdk::imaproc::advmorpho::ridgeLine3dImg_multiSlice (const ipsdk::image::ImageConstPtr &pInImg3d, const ipsdk::imaproc::attr::ePropagationAxis &pInPropagationAxis, const ipsdk::imaproc::attr::ePropagationDirection &pInPropagationDirection, const ipsdk::ipUInt32 nbIter, const ipsdk::image::ImagePtr &pOutShortestPathImg, const ipsdk::image::ImagePtr &pOutDistanceMap, const ipsdk::image::ImagePtr &pOutPathMap) |
| | wrapper function for Computes the shortest path from one border to its opposite, given distance ponderation map. More...
|
| |
| IPSDKIPLADVANCEDMORPHOLOGY_API ipsdk::imaproc::attr::PlanIndexedVoxels3dPtr | ipsdk::imaproc::advmorpho::ridgeLine3dImg_multiSlice (const ipsdk::image::ImageConstPtr &pInImg3d, const ipsdk::image::ImageConstPtr &pInOptMaskImg, const ipsdk::imaproc::attr::ePropagationAxis &pInPropagationAxis, const ipsdk::imaproc::attr::ePropagationDirection &pInPropagationDirection, const ipsdk::ipUInt32 nbIter, const ipsdk::image::ImagePtr &pOutShortestPathImg, const ipsdk::image::ImagePtr &pOutDistanceMap, const ipsdk::image::ImagePtr &pOutPathMap) |
| | wrapper function for Computes the shortest path from one border to its opposite, given distance ponderation map. More...
|
| |
Computes the shortest path from one border to its opposite, given distance ponderation map.
The 3D ridge line algorithm allows to compute the shortest path to cross an image along the x, y, or z axis. It is also possible to specify the propagation direction. This direction can be direct (from left to right, from top to bottom or from the first to the last slice) or reverse (from right to left, from bottom to top or from the last to the first slice).
The distance between to reach a voxel one of its 26-neighbours is given by its intensity. More the intensity will be important, more the access to the voxel will be unfavourable. This means that the algorithms try to find a path through dark voxels.
The algorithm returns :
- the distance map,
- the path map to indicate the nearest neighbour to the current voxel,
- the list of the pixels composing the shortest path,
- optionally, the binary image of the shortest path. To avoid useless memory usage, this last result is calculated only if the pOutShortestPathImg image parameter is specified or if the algorithm is called with ridgeLine3dImg_withMinPathMap.
The calculation time can be drastically reduced by specifying a number of iterations. If this parameter is higher than 0, the algorithm will stop before converging to the final result. Although the result will be an approximation of the shortest path, it will stay close to the eact result.
Finally, it is possible to specify a propagation area by passing an additional mask as parameter.
The distance for each pixel of the shortest path is given by the intensity field of the Pixel2d data item. It is also possible to obtain the shortest path length for volume (c, t) thanks to the function computeShortestPathLength.
Please, see Ridge Line 2d for an illustration of shortest path in a 2d case.
Attributes description
Attribute description for algorithm :
Global Rule description
Global rule description for algorithm :
ipsdk::imaproc::matchSize (_pInImg3d,_pOutDistImg,_pOutIntImg) &&
ipsdk::imaproc::matchImagePlans (_pOutPIVoxels3d,_pInImg3d,eImagePlansMatchPolicy::eIPMP_CT) &&
ipsdk::processor::If (
ipsdk::processor::isSet (_pInOptMaskImg),
ipsdk::imaproc::matchSize (_pInImg3d,_pInOptMaskImg),
ipsdk::processor::none ()) &&
ipsdk::imaproc::matchSize (_pOutDistImg,_pOutBinImg)
Example of Python code :
Example imports
import PyIPSDK
import PyIPSDK.IPSDKIPLAdvancedMorphology as advmorpho
Code Example
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
outImgShortestPath, outPlanIndexedVoxels = advmorpho.ridgeLine3dImg(inImg, PyIPSDK.ePropagationAxis.ePA_X, PyIPSDK.ePropagationDirection.ePD_Direct)
firstShortestPath = PyIPSDK.toPyDict(outPlanIndexedVoxels)[(0, 0, 0)]
print("First shortest path", firstShortestPath)
Example of C++ code :
Example informations
Associated library
IPSDKIPLAdvancedMorphology
Header file
#include <IPSDKIPL/IPSDKIPLAdvancedMorphology/Processor/RidgeLine3dImg/RidgeLine3dImgInitPassLvl3.h>
#include <IPSDKIPL/IPSDKIPLAdvancedMorphology/Processor/RidgeLine3dImg/RidgeLine3dImgDirectPassLvl3.h>
#include <IPSDKIPL/IPSDKIPLAdvancedMorphology/Processor/RidgeLine3dImg/RidgeLine3dImgReversePassLvl3.h>
Code Example
const ImagePtr pShortestPathImg = rl3d_res._pShortestPath;
- See also
- RidgeLine3dImgLvl1
-
RidgeLine3dImgLvl2
◆ ridgeLine3dImg() [1/8]
wrapper function for Computes the shortest path from one border to its opposite, given distance ponderation map.
- Exceptions
-
◆ ridgeLine3dImg() [2/8]
wrapper function for Computes the shortest path from one border to its opposite, given distance ponderation map.
- Exceptions
-
◆ ridgeLine3dImg() [3/8]
wrapper function for Computes the shortest path from one border to its opposite, given distance ponderation map.
- Exceptions
-
◆ ridgeLine3dImg() [4/8]
wrapper function for Computes the shortest path from one border to its opposite, given distance ponderation map.
- Exceptions
-
◆ ridgeLine3dImg() [5/8]
wrapper function for Computes the shortest path from one border to its opposite, given distance ponderation map.
- Exceptions
-
◆ ridgeLine3dImg() [6/8]
wrapper function for Computes the shortest path from one border to its opposite, given distance ponderation map.
- Exceptions
-
◆ ridgeLine3dImg() [7/8]
wrapper function for Computes the shortest path from one border to its opposite, given distance ponderation map.
- Exceptions
-
◆ ridgeLine3dImg() [8/8]
wrapper function for Computes the shortest path from one border to its opposite, given distance ponderation map.
- Exceptions
-
◆ ridgeLine3dImg_multiSlice() [1/4]
wrapper function for Computes the shortest path from one border to its opposite, given distance ponderation map.
- Exceptions
-
◆ ridgeLine3dImg_multiSlice() [2/4]
wrapper function for Computes the shortest path from one border to its opposite, given distance ponderation map.
- Exceptions
-
◆ ridgeLine3dImg_multiSlice() [3/4]
wrapper function for Computes the shortest path from one border to its opposite, given distance ponderation map.
- Exceptions
-
◆ ridgeLine3dImg_multiSlice() [4/4]
wrapper function for Computes the shortest path from one border to its opposite, given distance ponderation map.
- Exceptions
-