Mercurial > hg > orthanc
changeset 3432:297ad330900c
merge
author | Alain Mazy <alain@mazy.be> |
---|---|
date | Mon, 17 Jun 2019 23:37:07 +0200 |
parents | e0841192d7d0 (diff) 954d15f24366 (current diff) |
children | caa526bb65cc |
files | |
diffstat | 4 files changed, 15 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/Core/DicomParsing/ParsedDicomFile.cpp Mon Jun 17 18:04:02 2019 +0200 +++ b/Core/DicomParsing/ParsedDicomFile.cpp Mon Jun 17 23:37:07 2019 +0200 @@ -920,7 +920,7 @@ !GetTagValue(seriesUid, DICOM_TAG_SERIES_INSTANCE_UID) || !GetTagValue(instanceUid, DICOM_TAG_SOP_INSTANCE_UID)) { - throw OrthancException(ErrorCode_BadFileFormat); + throw OrthancException(ErrorCode_BadFileFormat, "missing PatientID, StudyInstanceUID, SeriesInstanceUID or SOPInstanceUID"); } return DicomInstanceHasher(patientId, studyUid, seriesUid, instanceUid);
--- a/Core/Images/ImageProcessing.cpp Mon Jun 17 18:04:02 2019 +0200 +++ b/Core/Images/ImageProcessing.cpp Mon Jun 17 23:37:07 2019 +0200 @@ -1442,6 +1442,13 @@ cpy.push_back((double)points[i].GetY()); } + // Draw the lines segments + for (size_t i = 0; i < (points.size() -1); i++) + { + ImageProcessing::DrawLineSegment(image, points[i].GetX(), points[i].GetY(), points[i+1].GetX(), points[i+1].GetY(), value_); + } + ImageProcessing::DrawLineSegment(image, points[points.size() -1].GetX(), points[points.size() -1].GetY(), points[0].GetX(), points[0].GetY(), value_); + std::vector<int32_t> nodeX; nodeX.resize(cpSize); int nodes, pixelX, pixelY, i, j, swap ;
--- a/OrthancServer/ServerJobs/ResourceModificationJob.cpp Mon Jun 17 18:04:02 2019 +0200 +++ b/OrthancServer/ServerJobs/ResourceModificationJob.cpp Mon Jun 17 23:37:07 2019 +0200 @@ -158,9 +158,9 @@ originalHasher.reset(new DicomInstanceHasher(original.GetHasher())); modified.reset(original.Clone(true)); } - catch (OrthancException&) + catch (OrthancException& e) { - LOG(WARNING) << "An instance was removed after the job was issued: " << instance; + LOG(WARNING) << "An error occurred while executing a Modification job on instance " << instance << ": " << e.GetDetails(); return false; }
--- a/UnitTestsSources/ImageProcessingTests.cpp Mon Jun 17 18:04:02 2019 +0200 +++ b/UnitTestsSources/ImageProcessingTests.cpp Mon Jun 17 23:37:07 2019 +0200 @@ -220,9 +220,11 @@ ASSERT_FLOAT_EQ(128, TestFixture::ImageTraits::GetFloatPixel(image, 6, 6)); ASSERT_FLOAT_EQ(128, TestFixture::ImageTraits::GetFloatPixel(image, 6, 0)); - // inside polygon (note: we don't test too close from the edges since the current algo is taking some margin from the edges and might be improved in that sense) + ASSERT_FLOAT_EQ(255, TestFixture::ImageTraits::GetFloatPixel(image, 1, 1)); ASSERT_FLOAT_EQ(255, TestFixture::ImageTraits::GetFloatPixel(image, 1, 2)); + ASSERT_FLOAT_EQ(255, TestFixture::ImageTraits::GetFloatPixel(image, 1, 5)); ASSERT_FLOAT_EQ(255, TestFixture::ImageTraits::GetFloatPixel(image, 2, 4)); + ASSERT_FLOAT_EQ(255, TestFixture::ImageTraits::GetFloatPixel(image, 5, 5)); } TYPED_TEST(TestIntegerImageTraits, FillPolygonLargerThanImage) @@ -254,7 +256,6 @@ Orthanc::ImageProcessing::FillPolygon(image, points, 255); - // inside polygon (note: we don't test too close from the edges since the current algo is taking some margin from the edges and might be improved in that sense) - ASSERT_FLOAT_EQ(255, TestFixture::ImageTraits::GetFloatPixel(image, 1, 1)); - ASSERT_FLOAT_EQ(255, TestFixture::ImageTraits::GetFloatPixel(image, image.GetWidth() - 2, image.GetHeight() - 2)); + ASSERT_FLOAT_EQ(255, TestFixture::ImageTraits::GetFloatPixel(image, 0, 0)); + ASSERT_FLOAT_EQ(255, TestFixture::ImageTraits::GetFloatPixel(image, image.GetWidth() - 1, image.GetHeight() - 1)); }