From d5c4d3d92a58bd44f710a50fd9d13f65c8226d9f Mon Sep 17 00:00:00 2001 From: sdk-team Date: Wed, 3 Mar 2021 02:43:48 +0000 Subject: [PATCH] Update ScreenChestCT. --- CHANGELOG | 3 + imageprocess/2020-03-20/CalcCACS.xml | 1 + imageprocess/2020-03-20/ClassifyFNF.xml | 1 + imageprocess/2020-03-20/DetectCovid19Cad.xml | 1 + .../2020-03-20/DetectHipKeypointXRay.xml | 1 + .../2020-03-20/DetectKneeKeypointXRay.xml | 1 + imageprocess/2020-03-20/DetectKneeXRay.xml | 1 + imageprocess/2020-03-20/DetectLungNodule.xml | 1 + imageprocess/2020-03-20/DetectRibFracture.xml | 1 + imageprocess/2020-03-20/DetectSkinDisease.xml | 1 + imageprocess/2020-03-20/DetectSpineMRI.xml | 1 + imageprocess/2020-03-20/GetAsyncJobResult.xml | 1 + imageprocess/2020-03-20/RunCTRegistration.xml | 1 + imageprocess/2020-03-20/RunMedQA.xml | 1 + imageprocess/2020-03-20/ScreenChestCT.xml | 1 + imageprocess/2020-03-20/TranslateMed.xml | 1 + .../imageprocess/model/ScreenChestCTRequest.h | 6 +- .../imageprocess/model/ScreenChestCTResult.h | 50 ++++--- .../src/model/ScreenChestCTRequest.cc | 22 +-- imageprocess/src/model/ScreenChestCTResult.cc | 125 ++++++++++++------ imageprocess/version-2020-03-20.xml | 1 + 21 files changed, 151 insertions(+), 71 deletions(-) create mode 100644 imageprocess/2020-03-20/CalcCACS.xml create mode 100644 imageprocess/2020-03-20/ClassifyFNF.xml create mode 100644 imageprocess/2020-03-20/DetectCovid19Cad.xml create mode 100644 imageprocess/2020-03-20/DetectHipKeypointXRay.xml create mode 100644 imageprocess/2020-03-20/DetectKneeKeypointXRay.xml create mode 100644 imageprocess/2020-03-20/DetectKneeXRay.xml create mode 100644 imageprocess/2020-03-20/DetectLungNodule.xml create mode 100644 imageprocess/2020-03-20/DetectRibFracture.xml create mode 100644 imageprocess/2020-03-20/DetectSkinDisease.xml create mode 100644 imageprocess/2020-03-20/DetectSpineMRI.xml create mode 100644 imageprocess/2020-03-20/GetAsyncJobResult.xml create mode 100644 imageprocess/2020-03-20/RunCTRegistration.xml create mode 100644 imageprocess/2020-03-20/RunMedQA.xml create mode 100644 imageprocess/2020-03-20/ScreenChestCT.xml create mode 100644 imageprocess/2020-03-20/TranslateMed.xml create mode 100644 imageprocess/version-2020-03-20.xml diff --git a/CHANGELOG b/CHANGELOG index 4bcc0a535..ed3eac5d7 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2021-03-03 Version: patch +- Update ScreenChestCT. + 2021-03-02 Version: patch - Update default endpoints. diff --git a/imageprocess/2020-03-20/CalcCACS.xml b/imageprocess/2020-03-20/CalcCACS.xml new file mode 100644 index 000000000..428d59ce7 --- /dev/null +++ b/imageprocess/2020-03-20/CalcCACS.xml @@ -0,0 +1 @@ + diff --git a/imageprocess/2020-03-20/ClassifyFNF.xml b/imageprocess/2020-03-20/ClassifyFNF.xml new file mode 100644 index 000000000..df64b55b8 --- /dev/null +++ b/imageprocess/2020-03-20/ClassifyFNF.xml @@ -0,0 +1 @@ + diff --git a/imageprocess/2020-03-20/DetectCovid19Cad.xml b/imageprocess/2020-03-20/DetectCovid19Cad.xml new file mode 100644 index 000000000..0f2bc8201 --- /dev/null +++ b/imageprocess/2020-03-20/DetectCovid19Cad.xml @@ -0,0 +1 @@ + diff --git a/imageprocess/2020-03-20/DetectHipKeypointXRay.xml b/imageprocess/2020-03-20/DetectHipKeypointXRay.xml new file mode 100644 index 000000000..07b97de64 --- /dev/null +++ b/imageprocess/2020-03-20/DetectHipKeypointXRay.xml @@ -0,0 +1 @@ + diff --git a/imageprocess/2020-03-20/DetectKneeKeypointXRay.xml b/imageprocess/2020-03-20/DetectKneeKeypointXRay.xml new file mode 100644 index 000000000..aac3fc8f7 --- /dev/null +++ b/imageprocess/2020-03-20/DetectKneeKeypointXRay.xml @@ -0,0 +1 @@ + diff --git a/imageprocess/2020-03-20/DetectKneeXRay.xml b/imageprocess/2020-03-20/DetectKneeXRay.xml new file mode 100644 index 000000000..6b5421b44 --- /dev/null +++ b/imageprocess/2020-03-20/DetectKneeXRay.xml @@ -0,0 +1 @@ + diff --git a/imageprocess/2020-03-20/DetectLungNodule.xml b/imageprocess/2020-03-20/DetectLungNodule.xml new file mode 100644 index 000000000..9667d9113 --- /dev/null +++ b/imageprocess/2020-03-20/DetectLungNodule.xml @@ -0,0 +1 @@ + diff --git a/imageprocess/2020-03-20/DetectRibFracture.xml b/imageprocess/2020-03-20/DetectRibFracture.xml new file mode 100644 index 000000000..5b4611caf --- /dev/null +++ b/imageprocess/2020-03-20/DetectRibFracture.xml @@ -0,0 +1 @@ + diff --git a/imageprocess/2020-03-20/DetectSkinDisease.xml b/imageprocess/2020-03-20/DetectSkinDisease.xml new file mode 100644 index 000000000..94c93c0d7 --- /dev/null +++ b/imageprocess/2020-03-20/DetectSkinDisease.xml @@ -0,0 +1 @@ + diff --git a/imageprocess/2020-03-20/DetectSpineMRI.xml b/imageprocess/2020-03-20/DetectSpineMRI.xml new file mode 100644 index 000000000..cb45ea3b9 --- /dev/null +++ b/imageprocess/2020-03-20/DetectSpineMRI.xml @@ -0,0 +1 @@ + diff --git a/imageprocess/2020-03-20/GetAsyncJobResult.xml b/imageprocess/2020-03-20/GetAsyncJobResult.xml new file mode 100644 index 000000000..3eb0f52db --- /dev/null +++ b/imageprocess/2020-03-20/GetAsyncJobResult.xml @@ -0,0 +1 @@ + diff --git a/imageprocess/2020-03-20/RunCTRegistration.xml b/imageprocess/2020-03-20/RunCTRegistration.xml new file mode 100644 index 000000000..e4cceddfc --- /dev/null +++ b/imageprocess/2020-03-20/RunCTRegistration.xml @@ -0,0 +1 @@ + diff --git a/imageprocess/2020-03-20/RunMedQA.xml b/imageprocess/2020-03-20/RunMedQA.xml new file mode 100644 index 000000000..25e472f50 --- /dev/null +++ b/imageprocess/2020-03-20/RunMedQA.xml @@ -0,0 +1 @@ + diff --git a/imageprocess/2020-03-20/ScreenChestCT.xml b/imageprocess/2020-03-20/ScreenChestCT.xml new file mode 100644 index 000000000..454b5bf78 --- /dev/null +++ b/imageprocess/2020-03-20/ScreenChestCT.xml @@ -0,0 +1 @@ + diff --git a/imageprocess/2020-03-20/TranslateMed.xml b/imageprocess/2020-03-20/TranslateMed.xml new file mode 100644 index 000000000..ec61714fc --- /dev/null +++ b/imageprocess/2020-03-20/TranslateMed.xml @@ -0,0 +1 @@ + diff --git a/imageprocess/include/alibabacloud/imageprocess/model/ScreenChestCTRequest.h b/imageprocess/include/alibabacloud/imageprocess/model/ScreenChestCTRequest.h index 8c08cc179..49a019b01 100644 --- a/imageprocess/include/alibabacloud/imageprocess/model/ScreenChestCTRequest.h +++ b/imageprocess/include/alibabacloud/imageprocess/model/ScreenChestCTRequest.h @@ -40,6 +40,8 @@ namespace AlibabaCloud ScreenChestCTRequest(); ~ScreenChestCTRequest(); + std::string getOrgName()const; + void setOrgName(const std::string& orgName); std::string getDataFormat()const; void setDataFormat(const std::string& dataFormat); std::vector getURLList()const; @@ -48,15 +50,13 @@ namespace AlibabaCloud void setOrgId(const std::string& orgId); bool getAsync()const; void setAsync(bool async); - std::string getOrgName()const; - void setOrgName(const std::string& orgName); private: + std::string orgName_; std::string dataFormat_; std::vector uRLList_; std::string orgId_; bool async_; - std::string orgName_; }; } diff --git a/imageprocess/include/alibabacloud/imageprocess/model/ScreenChestCTResult.h b/imageprocess/include/alibabacloud/imageprocess/model/ScreenChestCTResult.h index 0f6727e70..639676c72 100644 --- a/imageprocess/include/alibabacloud/imageprocess/model/ScreenChestCTResult.h +++ b/imageprocess/include/alibabacloud/imageprocess/model/ScreenChestCTResult.h @@ -34,6 +34,19 @@ namespace AlibabaCloud public: struct Data { + struct Covid + { + std::string newProbability; + std::string otherProbability; + std::string normalProbability; + std::string mask; + std::string lesionRatio; + }; + struct CACS + { + std::string score; + std::string resultUrl; + }; struct LungNodule { struct Serie @@ -42,13 +55,13 @@ namespace AlibabaCloud { float imageZ; float imageY; - std::string lobe; float imageX; + std::string lobe; std::string category; std::string lung; float meanValue; - float confidence; float volume; + float confidence; float x; float y; float z; @@ -63,34 +76,41 @@ namespace AlibabaCloud }; std::vector series; }; - struct CACS + struct DetectRibFracture { - std::string score; - std::string resultUrl; + struct DetectionsItem + { + long fractureCategory; + float fractureConfidence; + std::vector coordinateImage; + std::vector coordinates; + long fractureId; + }; + std::vector origin1; + std::vector spacing2; + std::vector detections; + std::string resultURL; }; - struct Covid - { - std::string newProbability; - std::string otherProbability; - std::string normalProbability; - std::string mask; - std::string lesionRatio; - }; - LungNodule lungNodule; - CACS cACS; Covid covid; + CACS cACS; + LungNodule lungNodule; + DetectRibFracture detectRibFracture; }; ScreenChestCTResult(); explicit ScreenChestCTResult(const std::string &payload); ~ScreenChestCTResult(); + std::string getMessage()const; Data getData()const; + std::string getCode()const; protected: void parse(const std::string &payload); private: + std::string message_; Data data_; + std::string code_; }; } diff --git a/imageprocess/src/model/ScreenChestCTRequest.cc b/imageprocess/src/model/ScreenChestCTRequest.cc index c3507938a..0cf5922df 100644 --- a/imageprocess/src/model/ScreenChestCTRequest.cc +++ b/imageprocess/src/model/ScreenChestCTRequest.cc @@ -27,6 +27,17 @@ ScreenChestCTRequest::ScreenChestCTRequest() : ScreenChestCTRequest::~ScreenChestCTRequest() {} +std::string ScreenChestCTRequest::getOrgName()const +{ + return orgName_; +} + +void ScreenChestCTRequest::setOrgName(const std::string& orgName) +{ + orgName_ = orgName; + setBodyParameter("OrgName", orgName); +} + std::string ScreenChestCTRequest::getDataFormat()const { return dataFormat_; @@ -75,14 +86,3 @@ void ScreenChestCTRequest::setAsync(bool async) setBodyParameter("Async", async ? "true" : "false"); } -std::string ScreenChestCTRequest::getOrgName()const -{ - return orgName_; -} - -void ScreenChestCTRequest::setOrgName(const std::string& orgName) -{ - orgName_ = orgName; - setBodyParameter("OrgName", orgName); -} - diff --git a/imageprocess/src/model/ScreenChestCTResult.cc b/imageprocess/src/model/ScreenChestCTResult.cc index a39146b92..5e2aacd9d 100644 --- a/imageprocess/src/model/ScreenChestCTResult.cc +++ b/imageprocess/src/model/ScreenChestCTResult.cc @@ -40,47 +40,63 @@ void ScreenChestCTResult::parse(const std::string &payload) reader.parse(payload, value); setRequestId(value["RequestId"].asString()); auto dataNode = value["Data"]; + auto covidNode = dataNode["Covid"]; + if(!covidNode["NewProbability"].isNull()) + data_.covid.newProbability = covidNode["NewProbability"].asString(); + if(!covidNode["OtherProbability"].isNull()) + data_.covid.otherProbability = covidNode["OtherProbability"].asString(); + if(!covidNode["NormalProbability"].isNull()) + data_.covid.normalProbability = covidNode["NormalProbability"].asString(); + if(!covidNode["Mask"].isNull()) + data_.covid.mask = covidNode["Mask"].asString(); + if(!covidNode["LesionRatio"].isNull()) + data_.covid.lesionRatio = covidNode["LesionRatio"].asString(); + auto cACSNode = dataNode["CACS"]; + if(!cACSNode["Score"].isNull()) + data_.cACS.score = cACSNode["Score"].asString(); + if(!cACSNode["ResultUrl"].isNull()) + data_.cACS.resultUrl = cACSNode["ResultUrl"].asString(); auto lungNoduleNode = dataNode["LungNodule"]; auto allSeriesNode = lungNoduleNode["Series"]["Serie"]; for (auto lungNoduleNodeSeriesSerie : allSeriesNode) { Data::LungNodule::Serie serieObject; - if(!lungNoduleNodeSeriesSerie["SeriesInstanceUid"].isNull()) - serieObject.seriesInstanceUid = lungNoduleNodeSeriesSerie["SeriesInstanceUid"].asString(); if(!lungNoduleNodeSeriesSerie["Report"].isNull()) serieObject.report = lungNoduleNodeSeriesSerie["Report"].asString(); + if(!lungNoduleNodeSeriesSerie["SeriesInstanceUid"].isNull()) + serieObject.seriesInstanceUid = lungNoduleNodeSeriesSerie["SeriesInstanceUid"].asString(); auto allElementsNode = lungNoduleNodeSeriesSerie["Elements"]["Element"]; for (auto lungNoduleNodeSeriesSerieElementsElement : allElementsNode) { Data::LungNodule::Serie::Element elementsObject; - if(!lungNoduleNodeSeriesSerieElementsElement["Category"].isNull()) - elementsObject.category = lungNoduleNodeSeriesSerieElementsElement["Category"].asString(); - if(!lungNoduleNodeSeriesSerieElementsElement["Confidence"].isNull()) - elementsObject.confidence = std::stof(lungNoduleNodeSeriesSerieElementsElement["Confidence"].asString()); - if(!lungNoduleNodeSeriesSerieElementsElement["Diameter"].isNull()) - elementsObject.diameter = std::stof(lungNoduleNodeSeriesSerieElementsElement["Diameter"].asString()); - if(!lungNoduleNodeSeriesSerieElementsElement["Lobe"].isNull()) - elementsObject.lobe = lungNoduleNodeSeriesSerieElementsElement["Lobe"].asString(); - if(!lungNoduleNodeSeriesSerieElementsElement["Lung"].isNull()) - elementsObject.lung = lungNoduleNodeSeriesSerieElementsElement["Lung"].asString(); - if(!lungNoduleNodeSeriesSerieElementsElement["X"].isNull()) - elementsObject.x = std::stof(lungNoduleNodeSeriesSerieElementsElement["X"].asString()); - if(!lungNoduleNodeSeriesSerieElementsElement["Z"].isNull()) - elementsObject.z = std::stof(lungNoduleNodeSeriesSerieElementsElement["Z"].asString()); - if(!lungNoduleNodeSeriesSerieElementsElement["Y"].isNull()) - elementsObject.y = std::stof(lungNoduleNodeSeriesSerieElementsElement["Y"].asString()); - if(!lungNoduleNodeSeriesSerieElementsElement["ImageX"].isNull()) - elementsObject.imageX = std::stof(lungNoduleNodeSeriesSerieElementsElement["ImageX"].asString()); - if(!lungNoduleNodeSeriesSerieElementsElement["ImageY"].isNull()) - elementsObject.imageY = std::stof(lungNoduleNodeSeriesSerieElementsElement["ImageY"].asString()); if(!lungNoduleNodeSeriesSerieElementsElement["ImageZ"].isNull()) elementsObject.imageZ = std::stof(lungNoduleNodeSeriesSerieElementsElement["ImageZ"].asString()); - if(!lungNoduleNodeSeriesSerieElementsElement["SOPInstanceUID"].isNull()) - elementsObject.sOPInstanceUID = lungNoduleNodeSeriesSerieElementsElement["SOPInstanceUID"].asString(); - if(!lungNoduleNodeSeriesSerieElementsElement["Volume"].isNull()) - elementsObject.volume = std::stof(lungNoduleNodeSeriesSerieElementsElement["Volume"].asString()); + if(!lungNoduleNodeSeriesSerieElementsElement["ImageY"].isNull()) + elementsObject.imageY = std::stof(lungNoduleNodeSeriesSerieElementsElement["ImageY"].asString()); + if(!lungNoduleNodeSeriesSerieElementsElement["ImageX"].isNull()) + elementsObject.imageX = std::stof(lungNoduleNodeSeriesSerieElementsElement["ImageX"].asString()); + if(!lungNoduleNodeSeriesSerieElementsElement["Lobe"].isNull()) + elementsObject.lobe = lungNoduleNodeSeriesSerieElementsElement["Lobe"].asString(); + if(!lungNoduleNodeSeriesSerieElementsElement["Category"].isNull()) + elementsObject.category = lungNoduleNodeSeriesSerieElementsElement["Category"].asString(); + if(!lungNoduleNodeSeriesSerieElementsElement["Lung"].isNull()) + elementsObject.lung = lungNoduleNodeSeriesSerieElementsElement["Lung"].asString(); if(!lungNoduleNodeSeriesSerieElementsElement["MeanValue"].isNull()) elementsObject.meanValue = std::stof(lungNoduleNodeSeriesSerieElementsElement["MeanValue"].asString()); + if(!lungNoduleNodeSeriesSerieElementsElement["Volume"].isNull()) + elementsObject.volume = std::stof(lungNoduleNodeSeriesSerieElementsElement["Volume"].asString()); + if(!lungNoduleNodeSeriesSerieElementsElement["Confidence"].isNull()) + elementsObject.confidence = std::stof(lungNoduleNodeSeriesSerieElementsElement["Confidence"].asString()); + if(!lungNoduleNodeSeriesSerieElementsElement["X"].isNull()) + elementsObject.x = std::stof(lungNoduleNodeSeriesSerieElementsElement["X"].asString()); + if(!lungNoduleNodeSeriesSerieElementsElement["Y"].isNull()) + elementsObject.y = std::stof(lungNoduleNodeSeriesSerieElementsElement["Y"].asString()); + if(!lungNoduleNodeSeriesSerieElementsElement["Z"].isNull()) + elementsObject.z = std::stof(lungNoduleNodeSeriesSerieElementsElement["Z"].asString()); + if(!lungNoduleNodeSeriesSerieElementsElement["SOPInstanceUID"].isNull()) + elementsObject.sOPInstanceUID = lungNoduleNodeSeriesSerieElementsElement["SOPInstanceUID"].asString(); + if(!lungNoduleNodeSeriesSerieElementsElement["Diameter"].isNull()) + elementsObject.diameter = std::stof(lungNoduleNodeSeriesSerieElementsElement["Diameter"].asString()); serieObject.elements.push_back(elementsObject); } auto allOrigin = value["Origin"]["Origin"]; @@ -91,27 +107,52 @@ void ScreenChestCTResult::parse(const std::string &payload) serieObject.spacing.push_back(value.asString()); data_.lungNodule.series.push_back(serieObject); } - auto cACSNode = dataNode["CACS"]; - if(!cACSNode["Score"].isNull()) - data_.cACS.score = cACSNode["Score"].asString(); - if(!cACSNode["ResultUrl"].isNull()) - data_.cACS.resultUrl = cACSNode["ResultUrl"].asString(); - auto covidNode = dataNode["Covid"]; - if(!covidNode["NewProbability"].isNull()) - data_.covid.newProbability = covidNode["NewProbability"].asString(); - if(!covidNode["NormalProbability"].isNull()) - data_.covid.normalProbability = covidNode["NormalProbability"].asString(); - if(!covidNode["OtherProbability"].isNull()) - data_.covid.otherProbability = covidNode["OtherProbability"].asString(); - if(!covidNode["LesionRatio"].isNull()) - data_.covid.lesionRatio = covidNode["LesionRatio"].asString(); - if(!covidNode["Mask"].isNull()) - data_.covid.mask = covidNode["Mask"].asString(); + auto detectRibFractureNode = dataNode["DetectRibFracture"]; + if(!detectRibFractureNode["ResultURL"].isNull()) + data_.detectRibFracture.resultURL = detectRibFractureNode["ResultURL"].asString(); + auto allDetectionsNode = detectRibFractureNode["Detections"]["DetectionsItem"]; + for (auto detectRibFractureNodeDetectionsDetectionsItem : allDetectionsNode) + { + Data::DetectRibFracture::DetectionsItem detectionsItemObject; + if(!detectRibFractureNodeDetectionsDetectionsItem["FractureCategory"].isNull()) + detectionsItemObject.fractureCategory = std::stol(detectRibFractureNodeDetectionsDetectionsItem["FractureCategory"].asString()); + if(!detectRibFractureNodeDetectionsDetectionsItem["FractureConfidence"].isNull()) + detectionsItemObject.fractureConfidence = std::stof(detectRibFractureNodeDetectionsDetectionsItem["FractureConfidence"].asString()); + if(!detectRibFractureNodeDetectionsDetectionsItem["FractureId"].isNull()) + detectionsItemObject.fractureId = std::stol(detectRibFractureNodeDetectionsDetectionsItem["FractureId"].asString()); + auto allCoordinateImage = value["CoordinateImage"]["CoordinateImage"]; + for (auto value : allCoordinateImage) + detectionsItemObject.coordinateImage.push_back(value.asString()); + auto allCoordinates = value["Coordinates"]["Coordinates"]; + for (auto value : allCoordinates) + detectionsItemObject.coordinates.push_back(value.asString()); + data_.detectRibFracture.detections.push_back(detectionsItemObject); + } + auto allOrigin1 = detectRibFractureNode["Origin"]["Origin"]; + for (auto value : allOrigin1) + data_.detectRibFracture.origin1.push_back(value.asString()); + auto allSpacing2 = detectRibFractureNode["Spacing"]["Spacing"]; + for (auto value : allSpacing2) + data_.detectRibFracture.spacing2.push_back(value.asString()); + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); + if(!value["Code"].isNull()) + code_ = value["Code"].asString(); } +std::string ScreenChestCTResult::getMessage()const +{ + return message_; +} + ScreenChestCTResult::Data ScreenChestCTResult::getData()const { return data_; } +std::string ScreenChestCTResult::getCode()const +{ + return code_; +} + diff --git a/imageprocess/version-2020-03-20.xml b/imageprocess/version-2020-03-20.xml new file mode 100644 index 000000000..2fb6ae748 --- /dev/null +++ b/imageprocess/version-2020-03-20.xml @@ -0,0 +1 @@ +