Class Client

Class Documentation

class Client

AIAA Client.

This class provides APIs to connect to AIAA server and perform operations like dextra3d, fixPolygon etc…

Public Functions

Client(const std::string &serverUri)

create AIAA Client object

Return
Client object
Parameters
  • serverUri: AIAA Server end-point. For example: “http://10.110.45.66:5000/v1”

ModelList models() const

This API is used to fetch all the possible Models support by AIAA Server.

Return
ModelList object representing a list of Models
Exceptions
  • nvidia.aiaa.error.101: in case of connect error
  • nvidia.aiaa.error.102: if case of response parsing

PointSet sampling(const Model &model, const PointSet &pointSet, const std::string &inputImageFile, Pixel::Type pixelType, int dimension, const std::string &outputImageFile, ImageInfo &imageInfo) const

This API is used to sample the input image.

Return
PointSet object representing new PointSet for sampled image
Parameters
  • model: Model to be used
  • pointSet: PointSet object which represents a set of points in 2D/3D/4D for the organ. Minimum Client::MIN_POINTS_FOR_SEGMENTATION are expected
  • inputImageFile: Input image filename where image is stored in 2D/3D/4D format
  • pixelType: Pixel::Type for Input Image
  • dimension: Dimension for Input Image
  • outputImageFile: Sampled Output Imaged stored in itk::Image<unsigned short, *> format
  • imageInfo: ImageInfo for sampled image
Exceptions
  • nvidia.aiaa.error.101: in case of connect error
  • nvidia.aiaa.error.103: if case of ITK error related to image processing

PointSet sampling(const Model &model, const PointSet &pointSet, void *inputImage, Pixel::Type pixelType, int dimension, const std::string &outputImageFile, ImageInfo &imageInfo) const

This API is used to sample the input image.

Return
PointSet object representing new PointSet for sampled image
Parameters
  • model: Model to be used
  • pointSet: PointSet object which represents a set of points in 3-Dimensional for the organ. Minimum Client::MIN_POINTS_FOR_SEGMENTATION are expected
  • inputImage: Input image pointer 2D/3D/4D format which is itk::Image<?, *> to avoid extra copy at client side
  • pixelType: Pixel::Type for Input Image
  • dimension: Dimension for Input Image
  • outputImageFile: Sampled Output Imaged stored in itk::Image<unsigned short, *> format
  • imageInfo: ImageInfo for sampled image
Exceptions
  • nvidia.aiaa.error.101: in case of connect error
  • nvidia.aiaa.error.103: if case of ITK error related to image processing

int segmentation(const Model &model, const PointSet &pointSet, const std::string &inputImageFile, int dimension, const std::string &outputImageFile, const ImageInfo &imageInfo) const

3D image segmentation over sampled input image and PointSet

Parameters
  • model: Model to be used
  • pointSet: PointSet object which represents a set of points in 3-Dimensional for the organ. Minimum Client::MIN_POINTS_FOR_SEGMENTATION are expected
  • dimension: Dimension for Input Image
  • inputImageFile: Sampled Input image filename where image is stored in itk::Image<unsigned short, *> format
  • outputImageFile: File name to store 3D binary mask image result from AIAA server in itk::Image<unsigned char, *> format
Return Value
  • 0: Success
  • -1: Insufficient Points in the input
  • -2: Input Model name is empty
Exceptions
  • nvidia.aiaa.error.101: in case of connect error
  • nvidia.aiaa.error.102: if case of response parsing
  • nvidia.aiaa.error.103: if case of ITK error related to image processing

int dextr3D(const Model &model, const PointSet &pointSet, const std::string &inputImageFile, Pixel::Type pixelType, const std::string &outputImageFile) const

3D image segmentation using DEXTR3D method (this combines sampling + segmentation into single operation for 3D images)

Parameters
  • model: Model to be used
  • pointSet: PointSet object which represents a set of points in 3-Dimensional for the organ. Minimum Client::MIN_POINTS_FOR_SEGMENTATION are expected
  • inputImageFile: Input image filename where image is stored in itk::Image<?, 3> format
  • pixelType: PixelType for Input Image
  • outputImageFile: File name to store 3D binary mask image result from AIAA server in itk::Image<unsigned char, 3> format
Return Value
  • 0: Success
  • -1: Insufficient Points in the input
  • -2: Input Model name is empty
Exceptions
  • nvidia.aiaa.error.101: in case of connect error
  • nvidia.aiaa.error.102: if case of response parsing
  • nvidia.aiaa.error.103: if case of ITK error related to image processing

PolygonsList maskToPolygon(int pointRatio, const std::string &inputImageFile) const

3D binary mask to polygon representation conversion

Return
PolygonsList object representing a list of Polygons across each image slice
Parameters
  • pointRatio: Point Ratio
  • inputImageFile: Input image filename where image is stored in itk::Image<unsigned char, *> format
Exceptions
  • nvidia.aiaa.error.101: in case of connect error
  • nvidia.aiaa.error.102: if case of response parsing

Polygons fixPolygon(const Polygons &newPoly, const Polygons &oldPrev, int neighborhoodSize, int polyIndex, int vertexIndex, const std::string &inputImageFile, const std::string &outputImageFile) const

2D polygon update with single point edit

Return
Polygons object representing set of updated polygons
Parameters
  • newPoly: Set of new Polygons which needs update
  • oldPrev: Set of current or old Polygons
  • neighborhoodSize: NeighborHood Size for propagation
  • polyIndex: Polygon index among new Poly which needs an update
  • vertexIndex: Vertex among the polygon which needs an update
  • inputImageFile: Input 2D Slice Image File in PNG format
  • outputImageFile: Output Image File in PNG format
Exceptions
  • nvidia.aiaa.error.101: in case of connect error
  • nvidia.aiaa.error.102: if case of response parsing

Public Static Attributes

const int MIN_POINTS_FOR_SEGMENTATION = 6

Minimum Number of Points required for segmentation/sampling.