Skip to content

Commit

Permalink
fix client docs for 1.0.2 release (NVIDIA#61)
Browse files Browse the repository at this point in the history
* fix client docs for 1.0.2 release
  • Loading branch information
SachidanandAlle authored Feb 28, 2020
1 parent f0cfc5e commit a2b83fd
Show file tree
Hide file tree
Showing 8 changed files with 136 additions and 37 deletions.
3 changes: 2 additions & 1 deletion cpp-client/include/nvidia/aiaa/model.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ struct AIAA_CLIENT_API Model {
/// Image ROI size used while training [x,y,z,w] Format; This shall be used for Annotation Models
std::vector<int> roi;

/// Model Types supported by AIAA
enum ModelType {
segmentation,
annotation,
Expand All @@ -72,7 +73,7 @@ struct AIAA_CLIENT_API Model {
unknown
};

/// Type of Model (segmentation/annotation)
/// Type of Model (segmentation/annotation etc..)
ModelType type;

/// Version of Model
Expand Down
8 changes: 4 additions & 4 deletions cpp-client/include/nvidia/aiaa/pointset.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,12 @@ namespace aiaa {
// PointSet //
////////////

/*!
@brief AIAA PointSet
*/

/// Type Definition for 2D/3D/4D Point
typedef std::vector<int> Point;

/*!
@brief AIAA PointSet
*/
struct AIAA_CLIENT_API PointSet {

/// Array of 2D/3D/4D Points to represent [[x,y,z,w]+]
Expand All @@ -64,6 +63,7 @@ struct AIAA_CLIENT_API PointSet {
/*!
@brief create Model from JSON String
@param[in] json JSON String
@param[in] key Specific key inside JSON String that represents PointSet.
3D Example:
@code
Expand Down
2 changes: 2 additions & 0 deletions cpp-client/include/nvidia/aiaa/polygon.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ struct AIAA_CLIENT_API Polygons {
/*!
@brief create Model from JSON String
@param[in] json JSON String.
@param[in] key Specific key inside JSON String that represents Polygons.
Example:
@code
Expand Down Expand Up @@ -122,6 +123,7 @@ struct AIAA_CLIENT_API PolygonsList {
/*!
@brief create PolygonsList from JSON String
@param[in] json JSON String.
@param[in] key Specific key inside JSON String that represents PolygonList.
Example:
@code
Expand Down
2 changes: 1 addition & 1 deletion cpp-client/include/nvidia/aiaa/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class AIAA_CLIENT_API Utils {
@brief 3D point
@param[in] str input string
@param[in] delim delimiter character
@param[in,out] point size which represents x,y,z
@return Point which represents x,y,z
*/
static Point stringToPoint(const std::string &str, char delim);

Expand Down
2 changes: 1 addition & 1 deletion cpp-client/tools/aiaa/aiaa-session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ int main(int argc, char **argv) {
" |-server Server URI {default: http://0.0.0.0:5000} |\n"
" *|-op Operation (create|get|delete) |\n"
" |-image Input Image File in case of (create) operation |\n"
" |-expiry Session expiry time in minutes (default: 0) |\n"
" |-expiry Session expiry time in seconds (default: 0) |\n"
" |-session Session ID in case of (get|delete) operation |\n"
" |-timeout Timeout In Seconds {default: 60} |\n"
" |-ts Print API Latency |\n";
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
copyright = u'2019, NVIDIA Corporation'
author = u'NVIDIA Corporation'

release = '1.0.1'
version = '1.0.1'
release = '1.0.2'
version = '1.0.2'

# -- General configuration ---------------------------------------------------
extensions = [
Expand Down
6 changes: 3 additions & 3 deletions docs/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Linux

.. code-block:: bash
export version=1.0.1
export version=1.0.2
wget https://github.com/NVIDIA/ai-assisted-annotation-client/releases/download/v${version}/NvidiaAIAAClient-${version}-Linux.sh
sudo sh NvidiaAIAAClient-${version}-Linux.sh --prefix=/usr/local --exclude_sub_dir --skip-license
Expand All @@ -60,7 +60,7 @@ MacOS

.. code-block:: bash
export version=1.0.1
export version=1.0.2
wget https://github.com/NVIDIA/ai-assisted-annotation-client/releases/download/v${version}/NvidiaAIAAClient-${version}-Darwin.sh
sh NvidiaAIAAClient-${version}-Darwin.sh --prefix=/usr/local --exclude_sub_dir --skip-license
Expand Down Expand Up @@ -148,7 +148,7 @@ You can achieve this by adding External Project in CMake.
...
ExternalProject_Add(NvidiaAIAAClient
GIT_REPOSITORY https://github.com/NVIDIA/ai-assisted-annotation-client.git
GIT_TAG v1.0.1
GIT_TAG v1.0.2
)
...
target_link_libraries(foo ${NvidiaAIAAClient_LIBRARY})
Expand Down
146 changes: 121 additions & 25 deletions docs/tools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,15 @@ C++ Tools
Simple C++ implementations for the client API’s are provided in tools/aiaa folder.
These tools are built and installed as part of the source build. Or you can download it directly from the release page.

.. attention::
Always use **-h** option to get the **latest information** on *options available* when you run these tools


List Models
-----------

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

Following are the options available

Expand All @@ -45,7 +48,7 @@ Following are the options available
:widths: 15, 40, 15, 30

-h,Prints the help information,,
-server,Server URI for AIAA Server,,-server http://10.110.45.66:5000/v1
-server,Server URI for AIAA Server,,-server http://0.0.0.0:5000
-label,Label Name for matching,,-label liver
-type,Find Matching Model of type (segmentation/annotation),,-type segmentation
-output,Save output result into a file,,-output models.json
Expand All @@ -55,15 +58,48 @@ Example
.. code-block:: bash
nvidiaAIAAListModels \
-server http://10.110.45.66:5000/v1 \
-server http://0.0.0.0:5000 \
-label spleen
Session
------------

Provides implementation for ``nvidia::aiaa::Client::create_session()``, ``nvidia::aiaa::Client::get_session()`` and ``nvidia::aiaa::Client::close_session()`` APIs.
For more details refer `aiaa-session.cpp <https://github.com/NVIDIA/ai-assisted-annotation-client/blob/master/cpp-client/tools/aiaa/aiaa-session.cpp>`_

Following are the options available

.. csv-table::
:header: Option,Description,Default,Example
:widths: auto

-h,Prints the help information,,
-server,Server URI for AIAA Server,,-server http://0.0.0.0:5000
-op,Session Operation (create|get|delete),,-op create
-image,Input image filename where image is stored in AIAA Session,,-image image.nii.gz
-expiry,Session expiry in seconds,,-expiry 3600
-session,Session ID incase of get or delete operation,,-session "9ad970be-530e-11ea-84e3-0242ac110007"

Example

.. code-block:: bash
nvidiaAIAASession \
-server http://0.0.0.0:5000 \
-op create \
-image _image.nii.gz
nvidiaAIAASession \
-server http://0.0.0.0:5000 \
-op delete \
-session "9ad970be-530e-11ea-84e3-0242ac110007"
DEXTR3D (Annotation)
--------------------

Provides implementation for ``nvidia::aiaa::Client::dextra3d()`` API.
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>`_
For more details refer `aiaa-dextra3d.cpp <https://github.com/NVIDIA/ai-assisted-annotation-client/blob/master/cpp-client/tools/aiaa/aiaa-dextra3d.cpp>`_

Following are the options available

Expand All @@ -72,7 +108,7 @@ Following are the options available
:widths: auto

-h,Prints the help information,,
-server,Server URI for AIAA Server,,-server http://10.110.45.66:5000/v1
-server,Server URI for AIAA Server,,-server http://0.0.0.0:5000
-label,Label Name for matching;  Either -model or -label is required,,-label liver
-model,Model Name,,-model Dextr3DLiver
-points,"JSON Array of 3D Points (Image Indices) in [[x,y,z]+] format",,"-points [[70,172,86],...,[105,161,180]]"
Expand All @@ -82,13 +118,14 @@ Following are the options available
-pad,Padding size for input Image,20,-pad 20
-roi,ROI Image size in XxYxZ format which is used while training the AIAA Model,128x128x128,-roi 96x96x96
-sigma,Sigma Value for AIAA Server,3,-sigma 3
-session,Session ID instead of -image option,,-session "9ad970be-530e-11ea-84e3-0242ac110007"

Example

.. code-block:: bash
nvidiaAIAADEXTR3D \
-server http://10.110.45.66:5000/v1 \
-server http://0.0.0.0:5000 \
-label spleen \
-points `cat ../test/data/pointset.json` \
-image _image.nii.gz \
Expand All @@ -100,8 +137,8 @@ Example
#(using model instead of label)
nvidiaAIAADEXTR3D \
-server http://10.110.45.66:5000/v1 \
-model Dextr3DSpleen \
-server http://0.0.0.0:5000 \
-model annotation_ct_spleen \
-points `cat ../test/data/pointset.json` \
-image _image.nii.gz \
-output tmp_out.nii.gz \
Expand All @@ -114,7 +151,7 @@ Segmentation
------------

Provides implementation for ``nvidia::aiaa::Client::segmentation()`` API.
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>`_
For more details refer `aiaa-segmentation.cpp <https://github.com/NVIDIA/ai-assisted-annotation-client/blob/master/cpp-client/tools/aiaa/aiaa-segmentation.cpp>`_

Following are the options available

Expand All @@ -123,36 +160,76 @@ Following are the options available
:widths: auto

-h,Prints the help information,,
-server,Server URI for AIAA Server,,-server http://10.110.45.66:5000/v1
-server,Server URI for AIAA Server,,-server http://0.0.0.0:5000
-label,Label Name for matching;  Either -model or -label is required,,-label liver
-model,Model Name,,-model Dextr3DLiver
-model,Model Name,,-model segmentation_ct_spleen
-image,Input image filename where image is stored in 3D format,,-image image.nii.gz
-output,File name to store 3D binary mask image result from AIAA server,,-output result.nii.gz
-session,Session ID instead of -image option,,-session "9ad970be-530e-11ea-84e3-0242ac110007"

Example

.. code-block:: bash
nvidiaAIAADSegmentation \
-server http://10.110.45.66:5000/v1 \
nvidiaAIAASegmentation \
-server http://0.0.0.0:5000 \
-label spleen \
-image _image.nii.gz \
-output tmp_out.nii.gz
#(using model instead of label)
nvidiaAIAADSegmentation \
-server http://10.110.45.66:5000/v1 \
nvidiaAIAASegmentation \
-server http://0.0.0.0:5000 \
-model segmentation_spleen \
-image _image.nii.gz \
-output tmp_out.nii.gz
Deepgrow
------------

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

Following are the options available

.. csv-table::
:header: Option,Description,Default,Example
:widths: auto

-h,Prints the help information,,
-server,Server URI for AIAA Server,,-server http://0.0.0.0:5000
-model,Model Name,,-model clara_deepgrow
-image,Input image filename where image is stored in 3D format,,-image image.nii.gz
-fpoints,"Foreground Points or clicks in [x,y,z] format",,"-fpoints [[285,207,105]]"
-bpoints,"Background Points or clicks in [x,y,z] format",,"-fpoints [[283,204,105]]"
-output,File name to store 3D binary mask image result from AIAA server,,-output result.nii.gz
-session,Session ID instead of -image option,,-session "9ad970be-530e-11ea-84e3-0242ac110007"

Example

.. code-block:: bash
nvidiaAIAADeepgrow \
-server http://0.0.0.0:5000 \
-model clara_deepgrow \
-image _image.nii.gz \
-fpoints [[283,204,105]] \
-output tmp_out.nii.gz
nvidiaAIAADeepgrow \
-server http://0.0.0.0:5000 \
-model clara_deepgrow \
-session "9ad970be-530e-11ea-84e3-0242ac110007" \
-fpoints [[283,204,105]] \
-output tmp_out.nii.gz
Mask To Polygon
------------------

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

Following are the options available

Expand All @@ -161,7 +238,7 @@ Following are the options available
:widths: auto

-h,Prints the help information,,
-server,Server URI for AIAA Server,,-server http://10.110.45.66:5000/v1
-server,Server URI for AIAA Server,,-server http://0.0.0.0:5000
-ratio,Point Ratio,10,-ratio 10
-input,Input 3D binary mask image file name (which is an output of dextra3d),,-input tmp_out.nii.gz
-output,Save output result (JSON Array) representing the list of polygons per slice to a file,,-output polygonlist.json
Expand All @@ -171,7 +248,7 @@ Example
.. code-block:: bash
nvidiaAIAAMaskPolygon \
-server http://10.110.45.66:5000/v1 \
-server http://0.0.0.0:5000 \
-image tmp_out.nii.gz \
-output polygonlist.json
Expand All @@ -180,7 +257,7 @@ Fix Polygon
-----------

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

Following are the options available

Expand All @@ -189,27 +266,46 @@ Following are the options available
:widths: auto

-h,Prints the help information,,
-server,Server URI for AIAA Server,,-server http://10.110.45.66:5000/v1
-server,Server URI for AIAA Server,,-server http://0.0.0.0:5000
-neighbor,Neighborhood size for propagation,1,-neighbor 1
-poly,"New 2D Polygon Array in [[[x,y]+]] format",,"-poly [[[54,162],…,[62,140]]]"
-ppoly,"Current or Old 2D Polygon Array in [[[x,y]+]] format",,"-poly [[[53,162],…,[62,140]]]"
-neighbor3d,3DNeighborhood size for propagation,1,-neighbor3d 1
-dim,Dimension 2D or 3D,2,-dim 2
-poly,"Current or Old 2D Polygon Array in [[[x,y]+]] format",,"-poly [[[53,162],…,[62,140]]]"
-sindex,Slice Index in-case of 3D volume which needs to be updated,,-sindex 0
-pindex,Polygon Index within new Polygon Array which needs to be updated,,-pindex 0
-vindex,Vertical Index within new Polygon Array which needs to be updated,,-vindex 17
-image,Input 2D image slice,,-image image_slice_2D.png
-xoffset,X Offset needs to be added to get new vertex value,,-xoffset 2
-yoffset,Y Offset needs to be added to get new vertex value,,-yoffset -4
-image,Input 2D/3D image,,-image image_slice_2D.png
-output,Output file name to the updated image,,-output updated_image_2D.png

Example

.. code-block:: bash
nvidiaAIAAFixPolygon \
-server http://10.110.45.66:5000/v1 \
-server http://0.0.0.0:5000 \
-dim 2
-neighbor 1 \
-poly `cat ../test/data/polygons.json` \
-ppoly `cat ../test/data/polygons.json` \
-pindex 0 \
-vindex 17 \
-xoffset 8 \
-yoffset 5 \
-image ../test/data/image_slice_2D.png \
-output updated_image_2D.png
nvidiaAIAAFixPolygon \
-server http://0.0.0.0:5000 \
-dim 3
-neighbor 1 \
-neighbor3d 1 \
-poly `cat ../test/data/polygons3d.json` \
-sindex 104 \
-pindex 0 \
-vindex 4 \
-xoffset 8 \
-yoffset 5 \
-image _image.nii.gz \
-output image_mask.nii.gz

0 comments on commit a2b83fd

Please sign in to comment.