From a2b83fd030c498feedd0e84794864ff4f746e545 Mon Sep 17 00:00:00 2001 From: SACHIDANAND ALLE Date: Fri, 28 Feb 2020 20:24:51 +0000 Subject: [PATCH] fix client docs for 1.0.2 release (#61) * fix client docs for 1.0.2 release --- cpp-client/include/nvidia/aiaa/model.h | 3 +- cpp-client/include/nvidia/aiaa/pointset.h | 8 +- cpp-client/include/nvidia/aiaa/polygon.h | 2 + cpp-client/include/nvidia/aiaa/utils.h | 2 +- cpp-client/tools/aiaa/aiaa-session.cpp | 2 +- docs/conf.py | 4 +- docs/quickstart.rst | 6 +- docs/tools.rst | 146 ++++++++++++++++++---- 8 files changed, 136 insertions(+), 37 deletions(-) diff --git a/cpp-client/include/nvidia/aiaa/model.h b/cpp-client/include/nvidia/aiaa/model.h index d44a652..ebef3ba 100644 --- a/cpp-client/include/nvidia/aiaa/model.h +++ b/cpp-client/include/nvidia/aiaa/model.h @@ -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 roi; + /// Model Types supported by AIAA enum ModelType { segmentation, annotation, @@ -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 diff --git a/cpp-client/include/nvidia/aiaa/pointset.h b/cpp-client/include/nvidia/aiaa/pointset.h index 4f0efbf..5a1bd2f 100644 --- a/cpp-client/include/nvidia/aiaa/pointset.h +++ b/cpp-client/include/nvidia/aiaa/pointset.h @@ -40,13 +40,12 @@ namespace aiaa { // PointSet // //////////// -/*! - @brief AIAA PointSet - */ - /// Type Definition for 2D/3D/4D Point typedef std::vector Point; +/*! + @brief AIAA PointSet + */ struct AIAA_CLIENT_API PointSet { /// Array of 2D/3D/4D Points to represent [[x,y,z,w]+] @@ -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 diff --git a/cpp-client/include/nvidia/aiaa/polygon.h b/cpp-client/include/nvidia/aiaa/polygon.h index 9340995..e84952c 100644 --- a/cpp-client/include/nvidia/aiaa/polygon.h +++ b/cpp-client/include/nvidia/aiaa/polygon.h @@ -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 @@ -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 diff --git a/cpp-client/include/nvidia/aiaa/utils.h b/cpp-client/include/nvidia/aiaa/utils.h index c9cf394..4da4935 100644 --- a/cpp-client/include/nvidia/aiaa/utils.h +++ b/cpp-client/include/nvidia/aiaa/utils.h @@ -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); diff --git a/cpp-client/tools/aiaa/aiaa-session.cpp b/cpp-client/tools/aiaa/aiaa-session.cpp index 375b905..68e2426 100644 --- a/cpp-client/tools/aiaa/aiaa-session.cpp +++ b/cpp-client/tools/aiaa/aiaa-session.cpp @@ -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"; diff --git a/docs/conf.py b/docs/conf.py index 3931e0c..2468be7 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -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 = [ diff --git a/docs/quickstart.rst b/docs/quickstart.rst index 040480a..bd0a67c 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -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 @@ -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 @@ -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}) diff --git a/docs/tools.rst b/docs/tools.rst index 51bc280..8217dc5 100644 --- a/docs/tools.rst +++ b/docs/tools.rst @@ -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 `_ +For more details refer `aiaa-model.cpp `_ Following are the options available @@ -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 @@ -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 `_ + +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 `_ +For more details refer `aiaa-dextra3d.cpp `_ Following are the options available @@ -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]]" @@ -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 \ @@ -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 \ @@ -114,7 +151,7 @@ Segmentation ------------ Provides implementation for ``nvidia::aiaa::Client::segmentation()`` API. -For more details refer `aiaa-segmentation.cpp `_ +For more details refer `aiaa-segmentation.cpp `_ Following are the options available @@ -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 `_ + +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 `_ +For more details refer `aiaa-mask-polygon.cpp `_ Following are the options available @@ -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 @@ -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 @@ -180,7 +257,7 @@ Fix Polygon ----------- Provides implementation for ``nvidia::aiaa::Client::mask2Polygon()`` API. -For more details refer `aiaa-fix-polygon.cpp `_ +For more details refer `aiaa-fix-polygon.cpp `_ Following are the options available @@ -189,13 +266,17 @@ 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 @@ -203,13 +284,28 @@ 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