Release DetectRibFracture.

This commit is contained in:
sdk-team
2020-12-22 07:01:04 +00:00
parent 58b398b978
commit 196b891ec3
12 changed files with 777 additions and 0 deletions

View File

@@ -35,6 +35,8 @@ set(imageprocess_public_header_model
include/alibabacloud/imageprocess/model/DetectKneeXRayResult.h
include/alibabacloud/imageprocess/model/DetectLungNoduleRequest.h
include/alibabacloud/imageprocess/model/DetectLungNoduleResult.h
include/alibabacloud/imageprocess/model/DetectRibFractureRequest.h
include/alibabacloud/imageprocess/model/DetectRibFractureResult.h
include/alibabacloud/imageprocess/model/DetectSkinDiseaseRequest.h
include/alibabacloud/imageprocess/model/DetectSkinDiseaseResult.h
include/alibabacloud/imageprocess/model/DetectSpineMRIRequest.h
@@ -45,6 +47,8 @@ set(imageprocess_public_header_model
include/alibabacloud/imageprocess/model/RunCTRegistrationResult.h
include/alibabacloud/imageprocess/model/RunMedQARequest.h
include/alibabacloud/imageprocess/model/RunMedQAResult.h
include/alibabacloud/imageprocess/model/ScreenChestCTRequest.h
include/alibabacloud/imageprocess/model/ScreenChestCTResult.h
include/alibabacloud/imageprocess/model/TranslateMedRequest.h
include/alibabacloud/imageprocess/model/TranslateMedResult.h )
@@ -64,6 +68,8 @@ set(imageprocess_src
src/model/DetectKneeXRayResult.cc
src/model/DetectLungNoduleRequest.cc
src/model/DetectLungNoduleResult.cc
src/model/DetectRibFractureRequest.cc
src/model/DetectRibFractureResult.cc
src/model/DetectSkinDiseaseRequest.cc
src/model/DetectSkinDiseaseResult.cc
src/model/DetectSpineMRIRequest.cc
@@ -74,6 +80,8 @@ set(imageprocess_src
src/model/RunCTRegistrationResult.cc
src/model/RunMedQARequest.cc
src/model/RunMedQAResult.cc
src/model/ScreenChestCTRequest.cc
src/model/ScreenChestCTResult.cc
src/model/TranslateMedRequest.cc
src/model/TranslateMedResult.cc )

View File

@@ -36,6 +36,8 @@
#include "model/DetectKneeXRayResult.h"
#include "model/DetectLungNoduleRequest.h"
#include "model/DetectLungNoduleResult.h"
#include "model/DetectRibFractureRequest.h"
#include "model/DetectRibFractureResult.h"
#include "model/DetectSkinDiseaseRequest.h"
#include "model/DetectSkinDiseaseResult.h"
#include "model/DetectSpineMRIRequest.h"
@@ -46,6 +48,8 @@
#include "model/RunCTRegistrationResult.h"
#include "model/RunMedQARequest.h"
#include "model/RunMedQAResult.h"
#include "model/ScreenChestCTRequest.h"
#include "model/ScreenChestCTResult.h"
#include "model/TranslateMedRequest.h"
#include "model/TranslateMedResult.h"
@@ -78,6 +82,9 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::DetectLungNoduleResult> DetectLungNoduleOutcome;
typedef std::future<DetectLungNoduleOutcome> DetectLungNoduleOutcomeCallable;
typedef std::function<void(const ImageprocessClient*, const Model::DetectLungNoduleRequest&, const DetectLungNoduleOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DetectLungNoduleAsyncHandler;
typedef Outcome<Error, Model::DetectRibFractureResult> DetectRibFractureOutcome;
typedef std::future<DetectRibFractureOutcome> DetectRibFractureOutcomeCallable;
typedef std::function<void(const ImageprocessClient*, const Model::DetectRibFractureRequest&, const DetectRibFractureOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DetectRibFractureAsyncHandler;
typedef Outcome<Error, Model::DetectSkinDiseaseResult> DetectSkinDiseaseOutcome;
typedef std::future<DetectSkinDiseaseOutcome> DetectSkinDiseaseOutcomeCallable;
typedef std::function<void(const ImageprocessClient*, const Model::DetectSkinDiseaseRequest&, const DetectSkinDiseaseOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DetectSkinDiseaseAsyncHandler;
@@ -93,6 +100,9 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::RunMedQAResult> RunMedQAOutcome;
typedef std::future<RunMedQAOutcome> RunMedQAOutcomeCallable;
typedef std::function<void(const ImageprocessClient*, const Model::RunMedQARequest&, const RunMedQAOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RunMedQAAsyncHandler;
typedef Outcome<Error, Model::ScreenChestCTResult> ScreenChestCTOutcome;
typedef std::future<ScreenChestCTOutcome> ScreenChestCTOutcomeCallable;
typedef std::function<void(const ImageprocessClient*, const Model::ScreenChestCTRequest&, const ScreenChestCTOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ScreenChestCTAsyncHandler;
typedef Outcome<Error, Model::TranslateMedResult> TranslateMedOutcome;
typedef std::future<TranslateMedOutcome> TranslateMedOutcomeCallable;
typedef std::function<void(const ImageprocessClient*, const Model::TranslateMedRequest&, const TranslateMedOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> TranslateMedAsyncHandler;
@@ -122,6 +132,9 @@ namespace AlibabaCloud
DetectLungNoduleOutcome detectLungNodule(const Model::DetectLungNoduleRequest &request)const;
void detectLungNoduleAsync(const Model::DetectLungNoduleRequest& request, const DetectLungNoduleAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
DetectLungNoduleOutcomeCallable detectLungNoduleCallable(const Model::DetectLungNoduleRequest& request) const;
DetectRibFractureOutcome detectRibFracture(const Model::DetectRibFractureRequest &request)const;
void detectRibFractureAsync(const Model::DetectRibFractureRequest& request, const DetectRibFractureAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
DetectRibFractureOutcomeCallable detectRibFractureCallable(const Model::DetectRibFractureRequest& request) const;
DetectSkinDiseaseOutcome detectSkinDisease(const Model::DetectSkinDiseaseRequest &request)const;
void detectSkinDiseaseAsync(const Model::DetectSkinDiseaseRequest& request, const DetectSkinDiseaseAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
DetectSkinDiseaseOutcomeCallable detectSkinDiseaseCallable(const Model::DetectSkinDiseaseRequest& request) const;
@@ -137,6 +150,9 @@ namespace AlibabaCloud
RunMedQAOutcome runMedQA(const Model::RunMedQARequest &request)const;
void runMedQAAsync(const Model::RunMedQARequest& request, const RunMedQAAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
RunMedQAOutcomeCallable runMedQACallable(const Model::RunMedQARequest& request) const;
ScreenChestCTOutcome screenChestCT(const Model::ScreenChestCTRequest &request)const;
void screenChestCTAsync(const Model::ScreenChestCTRequest& request, const ScreenChestCTAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ScreenChestCTOutcomeCallable screenChestCTCallable(const Model::ScreenChestCTRequest& request) const;
TranslateMedOutcome translateMed(const Model::TranslateMedRequest &request)const;
void translateMedAsync(const Model::TranslateMedRequest& request, const TranslateMedAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
TranslateMedOutcomeCallable translateMedCallable(const Model::TranslateMedRequest& request) const;

View File

@@ -0,0 +1,68 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ALIBABACLOUD_IMAGEPROCESS_MODEL_DETECTRIBFRACTUREREQUEST_H_
#define ALIBABACLOUD_IMAGEPROCESS_MODEL_DETECTRIBFRACTUREREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/imageprocess/ImageprocessExport.h>
namespace AlibabaCloud
{
namespace Imageprocess
{
namespace Model
{
class ALIBABACLOUD_IMAGEPROCESS_EXPORT DetectRibFractureRequest : public RpcServiceRequest
{
public:
struct URLList
{
std::string uRL;
};
public:
DetectRibFractureRequest();
~DetectRibFractureRequest();
std::string getDataFormat()const;
void setDataFormat(const std::string& dataFormat);
std::vector<URLList> getURLList()const;
void setURLList(const std::vector<URLList>& uRLList);
std::string getOrgId()const;
void setOrgId(const std::string& orgId);
bool getAsync()const;
void setAsync(bool async);
std::string getOrgName()const;
void setOrgName(const std::string& orgName);
std::string getSourceType()const;
void setSourceType(const std::string& sourceType);
private:
std::string dataFormat_;
std::vector<URLList> uRLList_;
std::string orgId_;
bool async_;
std::string orgName_;
std::string sourceType_;
};
}
}
}
#endif // !ALIBABACLOUD_IMAGEPROCESS_MODEL_DETECTRIBFRACTUREREQUEST_H_

View File

@@ -0,0 +1,66 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ALIBABACLOUD_IMAGEPROCESS_MODEL_DETECTRIBFRACTURERESULT_H_
#define ALIBABACLOUD_IMAGEPROCESS_MODEL_DETECTRIBFRACTURERESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/imageprocess/ImageprocessExport.h>
namespace AlibabaCloud
{
namespace Imageprocess
{
namespace Model
{
class ALIBABACLOUD_IMAGEPROCESS_EXPORT DetectRibFractureResult : public ServiceResult
{
public:
struct Data
{
struct DetectionsItem
{
float fractureConfidence;
std::string fractureCategory;
std::vector<std::string> coordinateImage;
std::vector<std::string> coordinates;
int fractureId;
};
std::vector<std::string> origin;
std::vector<std::string> spacing;
std::vector<DetectionsItem> detections;
std::string resultURL;
};
DetectRibFractureResult();
explicit DetectRibFractureResult(const std::string &payload);
~DetectRibFractureResult();
Data getData()const;
protected:
void parse(const std::string &payload);
private:
Data data_;
};
}
}
}
#endif // !ALIBABACLOUD_IMAGEPROCESS_MODEL_DETECTRIBFRACTURERESULT_H_

View File

@@ -0,0 +1,65 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ALIBABACLOUD_IMAGEPROCESS_MODEL_SCREENCHESTCTREQUEST_H_
#define ALIBABACLOUD_IMAGEPROCESS_MODEL_SCREENCHESTCTREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/imageprocess/ImageprocessExport.h>
namespace AlibabaCloud
{
namespace Imageprocess
{
namespace Model
{
class ALIBABACLOUD_IMAGEPROCESS_EXPORT ScreenChestCTRequest : public RpcServiceRequest
{
public:
struct URLList
{
std::string uRL;
};
public:
ScreenChestCTRequest();
~ScreenChestCTRequest();
std::string getDataFormat()const;
void setDataFormat(const std::string& dataFormat);
std::vector<URLList> getURLList()const;
void setURLList(const std::vector<URLList>& uRLList);
std::string getOrgId()const;
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 dataFormat_;
std::vector<URLList> uRLList_;
std::string orgId_;
bool async_;
std::string orgName_;
};
}
}
}
#endif // !ALIBABACLOUD_IMAGEPROCESS_MODEL_SCREENCHESTCTREQUEST_H_

View File

@@ -0,0 +1,99 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ALIBABACLOUD_IMAGEPROCESS_MODEL_SCREENCHESTCTRESULT_H_
#define ALIBABACLOUD_IMAGEPROCESS_MODEL_SCREENCHESTCTRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/imageprocess/ImageprocessExport.h>
namespace AlibabaCloud
{
namespace Imageprocess
{
namespace Model
{
class ALIBABACLOUD_IMAGEPROCESS_EXPORT ScreenChestCTResult : public ServiceResult
{
public:
struct Data
{
struct LungNodule
{
struct Serie
{
struct Element
{
float imageZ;
float imageY;
std::string lobe;
float imageX;
std::string category;
std::string lung;
float meanValue;
float confidence;
float volume;
float x;
float y;
float z;
std::string sOPInstanceUID;
float diameter;
};
std::vector<std::string> origin;
std::string report;
std::vector<std::string> spacing;
std::vector<Serie::Element> elements;
std::string seriesInstanceUid;
};
std::vector<Serie> series;
};
struct CACS
{
std::string score;
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;
};
ScreenChestCTResult();
explicit ScreenChestCTResult(const std::string &payload);
~ScreenChestCTResult();
Data getData()const;
protected:
void parse(const std::string &payload);
private:
Data data_;
};
}
}
}
#endif // !ALIBABACLOUD_IMAGEPROCESS_MODEL_SCREENCHESTCTRESULT_H_

View File

@@ -303,6 +303,42 @@ ImageprocessClient::DetectLungNoduleOutcomeCallable ImageprocessClient::detectLu
return task->get_future();
}
ImageprocessClient::DetectRibFractureOutcome ImageprocessClient::detectRibFracture(const DetectRibFractureRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DetectRibFractureOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DetectRibFractureOutcome(DetectRibFractureResult(outcome.result()));
else
return DetectRibFractureOutcome(outcome.error());
}
void ImageprocessClient::detectRibFractureAsync(const DetectRibFractureRequest& request, const DetectRibFractureAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, detectRibFracture(request), context);
};
asyncExecute(new Runnable(fn));
}
ImageprocessClient::DetectRibFractureOutcomeCallable ImageprocessClient::detectRibFractureCallable(const DetectRibFractureRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DetectRibFractureOutcome()>>(
[this, request]()
{
return this->detectRibFracture(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ImageprocessClient::DetectSkinDiseaseOutcome ImageprocessClient::detectSkinDisease(const DetectSkinDiseaseRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -483,6 +519,42 @@ ImageprocessClient::RunMedQAOutcomeCallable ImageprocessClient::runMedQACallable
return task->get_future();
}
ImageprocessClient::ScreenChestCTOutcome ImageprocessClient::screenChestCT(const ScreenChestCTRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return ScreenChestCTOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return ScreenChestCTOutcome(ScreenChestCTResult(outcome.result()));
else
return ScreenChestCTOutcome(outcome.error());
}
void ImageprocessClient::screenChestCTAsync(const ScreenChestCTRequest& request, const ScreenChestCTAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, screenChestCT(request), context);
};
asyncExecute(new Runnable(fn));
}
ImageprocessClient::ScreenChestCTOutcomeCallable ImageprocessClient::screenChestCTCallable(const ScreenChestCTRequest &request) const
{
auto task = std::make_shared<std::packaged_task<ScreenChestCTOutcome()>>(
[this, request]()
{
return this->screenChestCT(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ImageprocessClient::TranslateMedOutcome ImageprocessClient::translateMed(const TranslateMedRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -0,0 +1,99 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <alibabacloud/imageprocess/model/DetectRibFractureRequest.h>
using AlibabaCloud::Imageprocess::Model::DetectRibFractureRequest;
DetectRibFractureRequest::DetectRibFractureRequest() :
RpcServiceRequest("imageprocess", "2020-03-20", "DetectRibFracture")
{
setMethod(HttpRequest::Method::Post);
}
DetectRibFractureRequest::~DetectRibFractureRequest()
{}
std::string DetectRibFractureRequest::getDataFormat()const
{
return dataFormat_;
}
void DetectRibFractureRequest::setDataFormat(const std::string& dataFormat)
{
dataFormat_ = dataFormat;
setBodyParameter("DataFormat", dataFormat);
}
std::vector<DetectRibFractureRequest::URLList> DetectRibFractureRequest::getURLList()const
{
return uRLList_;
}
void DetectRibFractureRequest::setURLList(const std::vector<URLList>& uRLList)
{
uRLList_ = uRLList;
for(int dep1 = 0; dep1!= uRLList.size(); dep1++) {
auto uRLListObj = uRLList.at(dep1);
std::string uRLListObjStr = "URLList." + std::to_string(dep1 + 1);
setParameter(uRLListObjStr + ".URL", uRLListObj.uRL);
}
}
std::string DetectRibFractureRequest::getOrgId()const
{
return orgId_;
}
void DetectRibFractureRequest::setOrgId(const std::string& orgId)
{
orgId_ = orgId;
setBodyParameter("OrgId", orgId);
}
bool DetectRibFractureRequest::getAsync()const
{
return async_;
}
void DetectRibFractureRequest::setAsync(bool async)
{
async_ = async;
setBodyParameter("Async", async ? "true" : "false");
}
std::string DetectRibFractureRequest::getOrgName()const
{
return orgName_;
}
void DetectRibFractureRequest::setOrgName(const std::string& orgName)
{
orgName_ = orgName;
setBodyParameter("OrgName", orgName);
}
std::string DetectRibFractureRequest::getSourceType()const
{
return sourceType_;
}
void DetectRibFractureRequest::setSourceType(const std::string& sourceType)
{
sourceType_ = sourceType;
setBodyParameter("SourceType", sourceType);
}

View File

@@ -0,0 +1,76 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <alibabacloud/imageprocess/model/DetectRibFractureResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Imageprocess;
using namespace AlibabaCloud::Imageprocess::Model;
DetectRibFractureResult::DetectRibFractureResult() :
ServiceResult()
{}
DetectRibFractureResult::DetectRibFractureResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DetectRibFractureResult::~DetectRibFractureResult()
{}
void DetectRibFractureResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto dataNode = value["Data"];
if(!dataNode["ResultURL"].isNull())
data_.resultURL = dataNode["ResultURL"].asString();
auto allDetectionsNode = dataNode["Detections"]["DetectionsItem"];
for (auto dataNodeDetectionsDetectionsItem : allDetectionsNode)
{
Data::DetectionsItem detectionsItemObject;
if(!dataNodeDetectionsDetectionsItem["FractureId"].isNull())
detectionsItemObject.fractureId = std::stoi(dataNodeDetectionsDetectionsItem["FractureId"].asString());
if(!dataNodeDetectionsDetectionsItem["FractureConfidence"].isNull())
detectionsItemObject.fractureConfidence = std::stof(dataNodeDetectionsDetectionsItem["FractureConfidence"].asString());
if(!dataNodeDetectionsDetectionsItem["FractureCategory"].isNull())
detectionsItemObject.fractureCategory = dataNodeDetectionsDetectionsItem["FractureCategory"].asString();
auto allCoordinates = value["Coordinates"]["Coordinates"];
for (auto value : allCoordinates)
detectionsItemObject.coordinates.push_back(value.asString());
auto allCoordinateImage = value["CoordinateImage"]["CoordinateImage"];
for (auto value : allCoordinateImage)
detectionsItemObject.coordinateImage.push_back(value.asString());
data_.detections.push_back(detectionsItemObject);
}
auto allSpacing = dataNode["Spacing"]["Spacing"];
for (auto value : allSpacing)
data_.spacing.push_back(value.asString());
auto allOrigin = dataNode["Origin"]["Origin"];
for (auto value : allOrigin)
data_.origin.push_back(value.asString());
}
DetectRibFractureResult::Data DetectRibFractureResult::getData()const
{
return data_;
}

View File

@@ -0,0 +1,88 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <alibabacloud/imageprocess/model/ScreenChestCTRequest.h>
using AlibabaCloud::Imageprocess::Model::ScreenChestCTRequest;
ScreenChestCTRequest::ScreenChestCTRequest() :
RpcServiceRequest("imageprocess", "2020-03-20", "ScreenChestCT")
{
setMethod(HttpRequest::Method::Post);
}
ScreenChestCTRequest::~ScreenChestCTRequest()
{}
std::string ScreenChestCTRequest::getDataFormat()const
{
return dataFormat_;
}
void ScreenChestCTRequest::setDataFormat(const std::string& dataFormat)
{
dataFormat_ = dataFormat;
setBodyParameter("DataFormat", dataFormat);
}
std::vector<ScreenChestCTRequest::URLList> ScreenChestCTRequest::getURLList()const
{
return uRLList_;
}
void ScreenChestCTRequest::setURLList(const std::vector<URLList>& uRLList)
{
uRLList_ = uRLList;
for(int dep1 = 0; dep1!= uRLList.size(); dep1++) {
auto uRLListObj = uRLList.at(dep1);
std::string uRLListObjStr = "URLList." + std::to_string(dep1 + 1);
setParameter(uRLListObjStr + ".URL", uRLListObj.uRL);
}
}
std::string ScreenChestCTRequest::getOrgId()const
{
return orgId_;
}
void ScreenChestCTRequest::setOrgId(const std::string& orgId)
{
orgId_ = orgId;
setBodyParameter("OrgId", orgId);
}
bool ScreenChestCTRequest::getAsync()const
{
return async_;
}
void ScreenChestCTRequest::setAsync(bool async)
{
async_ = 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);
}

View File

@@ -0,0 +1,117 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <alibabacloud/imageprocess/model/ScreenChestCTResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Imageprocess;
using namespace AlibabaCloud::Imageprocess::Model;
ScreenChestCTResult::ScreenChestCTResult() :
ServiceResult()
{}
ScreenChestCTResult::ScreenChestCTResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
ScreenChestCTResult::~ScreenChestCTResult()
{}
void ScreenChestCTResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto dataNode = value["Data"];
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();
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["MeanValue"].isNull())
elementsObject.meanValue = std::stof(lungNoduleNodeSeriesSerieElementsElement["MeanValue"].asString());
serieObject.elements.push_back(elementsObject);
}
auto allOrigin = value["Origin"]["Origin"];
for (auto value : allOrigin)
serieObject.origin.push_back(value.asString());
auto allSpacing = value["Spacing"]["Spacing"];
for (auto value : allSpacing)
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();
}
ScreenChestCTResult::Data ScreenChestCTResult::getData()const
{
return data_;
}