Skip to content

Commit

Permalink
Fix previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
nroduit committed Dec 21, 2023
1 parent 507e02e commit a54e230
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,6 @@ public void run() {
Instant timeStarted = Instant.now();
double lastPos = 0;

String patientPseudoUID = DicomModel.getPatientPseudoUID(volTexture.getSeries());
List<SegSpecialElement> segList =
DicomSeries.getHiddenElementsFromPatient(patientPseudoUID, SegSpecialElement.class);

List<DicomImageElement> list = volTexture.getVolumeImages();
for (int i = 0; i < list.size(); i++) {
if (isInterrupted()) {
Expand Down Expand Up @@ -276,28 +272,6 @@ public void run() {
i,
Duration.between(start, Instant.now()).toMillis());

if (!segList.isEmpty()) {
Mat mask = Mat.zeros(imageMLUT.size(), imageMLUT.type());
for (SegSpecialElement seg : segList) {
if (seg.isVisible() && seg.containsSopInstanceUIDReference(imageElement)) {
Collection<EditableContour> contours = seg.getContours(imageElement);
if (!contours.isEmpty()) {
for (EditableContour c : contours) {
NonEditableGraphic graphic = c.getNonEditableGraphic();
if (graphic != null) {
List<MatOfPoint> pts =
ImageProcessor.transformShapeToContour(graphic.getShape(), false);
// TODO check the limit value
Imgproc.fillPoly(mask, pts, new Scalar(c.getCategory().getId()));
}
}
// Core.bitwise_and(src, mask, src);
}
}
}
imageMLUT = ImageCV.toImageCV(mask);
}

sumMemory += imageMLUT.physicalBytes();
if (sumMemory > maxMemory) {
start = Instant.now();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -738,11 +738,11 @@ private void koAction(Feature<?> action, Object selected) {

private ComboItemListener<ByteLut> newLutAction() {
List<ByteLut> luts = new ArrayList<>();
luts.add(ColorLut.GRAY.getByteLut());
luts.add(ByteLutCollection.Lut.GRAY.getByteLut());
ByteLutCollection.readLutFilesFromResourcesDir(
luts, ResourceUtil.getResource(DicomResource.LUTS));
// Set default first as the list has been sorted
luts.add(0, ColorLut.IMAGE.getByteLut());
luts.add(0, ByteLutCollection.Lut.IMAGE.getByteLut());

return new ComboItemListener<>(ActionW.LUT, luts.toArray(new ByteLut[0])) {

Expand Down

0 comments on commit a54e230

Please sign in to comment.