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, const int timeoutInSec = 60)

create AIAA Client object

Return

Client object

Parameters
  • [in] serverUri: AIAA Server end-point. For example: “http://10.110.45.66:5000/v1”

  • [in] timeoutInSec: AIAA Server operation timeout. Default is 60 seconds

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

ModelList models(const std::string &label, const Model::ModelType type) const

This API is used to fetch all the possible Models support by AIAA Server for matching label and model type.

Return

ModelList object representing a list of Models

Parameters
  • [in] label: Filter models by matching label

  • [in] type: Filter models by matching model type (segmentation/annotation)

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
  • [in] model: Model to be used

  • [in] pointSet: PointSet object which represents a set of points in 2D/3D/4D for the organ. Minimum Client::MIN_POINTS_FOR_SEGMENTATION are expected

  • [in] inputImageFile: Input image filename where image is stored in 2D/3D/4D format

  • [in] pixelType: Pixel::Type for Input Image

  • [in] dimension: Dimension for Input Image

  • [in] outputImageFile: Sampled Output Imaged stored in itk::Image<unsigned short, *> format

  • [out] 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
  • [in] model: Model to be used

  • [in] pointSet: PointSet object which represents a set of points in 3-Dimensional for the organ. Minimum Client::MIN_POINTS_FOR_SEGMENTATION are expected

  • [in] inputImage: Input image pointer 2D/3D/4D format which is itk::Image<?, *> to avoid extra copy at client side

  • [in] pixelType: Pixel::Type for Input Image

  • [in] dimension: Dimension for Input Image

  • [in] outputImageFile: Sampled Output Imaged stored in itk::Image<unsigned short, *> format

  • [out] 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 segmentation(const Model &model, const PointSet &pointSet, const std::string &inputImageFile, int dimension, const std::string &outputImageFile, const ImageInfo &imageInfo = ImageInfo()) const

3D image segmentation/annotation over sampled input image and PointSet depending on input Model

Parameters
  • [in] model: Model to be used (it can be for segmentation or annotation)

  • [in] pointSet: PointSet object which represents a set of points in 3-Dimensional for the organ.

  • [in] dimension: Dimension for Input Image

  • [in] inputImageFile: Sampled Input image filename where image is stored in itk::Image<unsigned short, *> format

  • [in] outputImageFile: File name to store 3D binary mask image result from AIAA server in itk::Image<unsigned char, *> format

  • [in] imageInfo: Optional Original ImageInfo to recover in case of annotation models after inference

Return Value
  • New/Updated: Pointset in case of segmentation which represents a set of extreme points in 3-Dimensional for the organ.

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 annotation using DEXTR3D method (this combines sampling + segmentation into single operation for 3D images)

Parameters
  • [in] model: Model to be used

  • [in] pointSet: PointSet object which represents a set of extreme points in 3-Dimensional for the organ. Minimum Client::MIN_POINTS_FOR_SEGMENTATION are expected

  • [in] inputImageFile: Input image filename where image is stored in itk::Image<?, 3> format

  • [in] pixelType: PixelType for Input Image

  • [in] 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
  • [in] pointRatio: Point Ratio

  • [in] 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
  • [in] newPoly: Set of new Polygons which needs update

  • [in] oldPrev: Set of current or old Polygons

  • [in] neighborhoodSize: NeighborHood Size for propagation

  • [in] polyIndex: Polygon index among new Poly which needs an update

  • [in] vertexIndex: Vertex among the polygon which needs an update

  • [in] inputImageFile: Input 2D Slice Image File in PNG format

  • [in] 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

Minimum Number of Points required for segmentation/sampling.