Skip to content

Commit d75806c

Browse files
Fix AIAA docs and update version to 1.0.1 (#16)
* Fix AIAA docs and update version to 1.0.1 * Encode space in URI param for label and model names
1 parent a12910d commit d75806c

7 files changed

Lines changed: 27 additions & 18 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ AI-Assisted Annotation is a cross-platform C++/Python Client API to communicate
1313
- Windows (Windows 10)
1414

1515
## Quick Start
16-
Follow the [Quick Start](https://docs.nvidia.com/clara/aiaa/sdk-api/docs/quickstart.html) guide to build/install AI-Assisted Annotation Client Libraries for C++/Python and run some basic tools to verify few important functionalities like *dextr3D*, *fixPolygon* over an existing AI-Assisted Annotation Server.
16+
Follow the [Quick Start](https://docs.nvidia.com/clara/aiaa/sdk-api/docs/quickstart.html) guide to build/install AI-Assisted Annotation Client Libraries for C++/Python and run some basic tools to verify few important functionalities like *dextr3D*, *segmentation*, *fixPolygon* over an existing AI-Assisted Annotation Server.
1717

1818
>C++ Client Library provides support for CMake project
1919

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.0
1+
1.0.1

cpp-client/include/nvidia/aiaa/client.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class AIAA_CLIENT_API Client {
5656
/*!
5757
@brief create AIAA Client object
5858
@param[in] serverUri AIAA Server end-point. For example: "http://10.110.45.66:5000/v1"
59-
@param[in] serverUri AIAA Server operation timeout. Default is 60 seconds
59+
@param[in] timeoutInSec AIAA Server operation timeout. Default is 60 seconds
6060
@return Client object
6161
*/
6262
Client(const std::string& serverUri, const int timeoutInSec = 60);
@@ -72,6 +72,8 @@ class AIAA_CLIENT_API Client {
7272

7373
/*!
7474
@brief This API is used to fetch all the possible Models support by AIAA Server for matching label and model type
75+
@param[in] label Filter models by matching label
76+
@param[in] type Filter models by matching model type (segmentation/annotation)
7577
@return ModelList object representing a list of Models
7678
7779
@throw nvidia.aiaa.error.101 in case of connect error
@@ -122,7 +124,7 @@ class AIAA_CLIENT_API Client {
122124
@param[in] outputImageFile File name to store 3D binary mask image result from AIAA server in itk::Image<unsigned char, *> format
123125
@param[in] imageInfo Optional Original ImageInfo to recover in case of annotation models after inference
124126
125-
@retval New/Updated Pointset in case of segmentation which represents a set of points in 3-Dimensional for the organ.
127+
@retval New/Updated Pointset in case of segmentation which represents a set of extreme points in 3-Dimensional for the organ.
126128
127129
@throw nvidia.aiaa.error.101 in case of connect error
128130
@throw nvidia.aiaa.error.102 if case of response parsing
@@ -134,7 +136,7 @@ class AIAA_CLIENT_API Client {
134136
/*!
135137
@brief 3D image annotation using DEXTR3D method (this combines sampling + segmentation into single operation for 3D images)
136138
@param[in] model Model to be used
137-
@param[in] pointSet PointSet object which represents a set of points in 3-Dimensional for the organ. Minimum Client::MIN_POINTS_FOR_SEGMENTATION are expected
139+
@param[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
138140
@param[in] inputImageFile Input image filename where image is stored in itk::Image<?, 3> format
139141
@param[in] pixelType PixelType for Input Image
140142
@param[in] outputImageFile File name to store 3D binary mask image result from AIAA server in itk::Image<unsigned char, 3> format

cpp-client/src/client.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ ModelList Client::models() const {
6060
}
6161

6262
ModelList Client::models(const std::string &label, const Model::ModelType type) const {
63-
std::string uri = serverUri + EP_MODELS + "?label=" + label;
63+
std::string l = label;
64+
std::replace(l.begin(), l.end(), ' ', '+');
65+
66+
std::string uri = serverUri + EP_MODELS + "?label=" + l;
6467
if (type != Model::unknown) {
6568
uri += std::string("&type=") + (type == Model::segmentation ? "segmentation" : "annotation");
6669
}
@@ -196,7 +199,10 @@ PointSet Client::segmentation(const Model &model, const PointSet &pointSet, cons
196199
std::string tmpResultFile = postProcess ? (Utils::tempfilename() + IMAGE_FILE_EXTENSION) : outputImageFile;
197200
AIAA_LOG_DEBUG("TmpResultFile: " << tmpResultFile << "; PostProcess: " << postProcess);
198201

199-
std::string uri = serverUri + (model.type == Model::segmentation ? EP_SEGMENTATION : EP_DEXTRA_3D) + "?model=" + model.name;
202+
std::string m = model.name;
203+
std::replace(m.begin(), m.end(), ' ', '+');
204+
std::string uri = serverUri + (model.type == Model::segmentation ? EP_SEGMENTATION : EP_DEXTRA_3D) + "?model=" + m;
205+
200206
std::string paramStr = "{\"sigma\":" + Utils::lexical_cast<std::string>(model.sigma) + ",\"points\":\"" + pointSet.toJson() + "\"}";
201207
std::string response = CurlUtils::doPost(uri, paramStr, inputImageFile, tmpResultFile, timeoutInSec);
202208

docs/quickstart.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Linux
4646

4747
.. code-block:: bash
4848
49-
export version=1.0.0
49+
export version=1.0.1
5050
wget https://github.com/NVIDIA/ai-assisted-annotation-client/releases/download/v${version}/NvidiaAIAAClient-${version}-Linux.sh
5151
sudo sh NvidiaAIAAClient-${version}-Linux.sh --prefix=/usr/local --exclude_sub_dir --skip-license
5252
@@ -60,7 +60,7 @@ MacOS
6060

6161
.. code-block:: bash
6262
63-
export version=1.0.0
63+
export version=1.0.1
6464
wget https://github.com/NVIDIA/ai-assisted-annotation-client/releases/download/v${version}/NvidiaAIAAClient-${version}-Darwin.sh
6565
sh NvidiaAIAAClient-${version}-Darwin.sh --prefix=/usr/local --exclude_sub_dir --skip-license
6666
@@ -122,7 +122,7 @@ Find Package
122122
^^^^^^^^^^^^
123123
To use this library from a CMake project, you can locate it directly with find_package() and use the namespaced imported target from the generated package configuration:
124124

125-
.. code-block:: guess
125+
::
126126

127127
# CMakeLists.txt
128128
find_package(NvidiaAIAAClient REQUIRED)
@@ -142,13 +142,13 @@ External Project
142142
^^^^^^^^^^^^^^^^
143143
You can achieve this by adding External Project in CMake.
144144

145-
.. code-block:: guess
145+
::
146146

147147
# CMakeLists.txt
148148
...
149149
ExternalProject_Add(NvidiaAIAAClient
150150
GIT_REPOSITORY https://github.com/NVIDIA/ai-assisted-annotation-client.git
151-
GIT_TAG v1.0.0
151+
GIT_TAG v1.0.1
152152
)
153153
...
154154
target_link_libraries(foo ${NvidiaAIAAClient_LIBRARY})

docs/tools.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ Following are the options available
4747
-h,Prints the help information,,
4848
-server,Server URI for AIAA Server,,-server http://10.110.45.66:5000/v1
4949
-label,Label Name for matching,,-label liver
50+
-type,Find Matching Model of type (segmentation/annotation),,-type segmentation
5051
-output,Save output result into a file,,-output models.json
5152

5253
Example
@@ -58,8 +59,8 @@ Example
5859
-label spleen
5960
6061
61-
DEXTR3D
62-
-------
62+
DEXTR3D (Annotation)
63+
--------------------
6364

6465
Provides implementation for ``nvidia::aiaa::Client::dextra3d()`` API.
6566
For more details refer `aiaa-dextra3d.cpp <https://github.com/NVIDIA/ai-assisted-annotation-client/blob/master/src/cpp-client/tools/aiaa/aiaa-dextra3d.cpp>`_
@@ -110,7 +111,7 @@ Example
110111
111112
112113
Segmentation
113-
-------
114+
------------
114115

115116
Provides implementation for ``nvidia::aiaa::Client::segmentation()`` API.
116117
For more details refer `aiaa-segmentation.cpp <https://github.com/NVIDIA/ai-assisted-annotation-client/blob/master/src/cpp-client/tools/aiaa/aiaa-segmentation.cpp>`_
@@ -147,8 +148,8 @@ Example
147148
-output tmp_out.nii.gz
148149
149150
150-
Mask 2D Polygon
151-
---------------
151+
Mask To 2D-Polygon
152+
------------------
152153

153154
Provides implementation for ``nvidia::aiaa::Client::mask2Polygon()`` API.
154155
For more details refer `aiaa-mask-polygon.cpp <https://github.com/NVIDIA/ai-assisted-annotation-client/blob/master/src/cpp-client/tools/aiaa/aiaa-mask-polygon.cpp>`_

py-client/client_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def dextr3d(self, model_name, image_file_path, result_file_prefix, point_set, pa
164164

165165
def segmentation(self, model_name, image_file_path, result_file_prefix, params):
166166
"""
167-
3D image segmentation using DEXTR3D method
167+
3D image segmentation method
168168
169169
:param model_name: model name according to the output of model_list()
170170
:param image_file_path: input 3D image file name

0 commit comments

Comments
 (0)