visboundaries/linewidth not rendering sharply when exporting figures
Hi everyone,
I am working with MATLAB to generate images that include segmentation lines (using visboundaries and viscircles) drawn over images. However, when I export these images (using saveas or print), the lines are not rendered sharply. Instead, they are much thicker. If I change the LineWidth to something like 0.5 a “halo”/outline effect appears around them. Interestingly, when I zoom into the figure manually within MATLAB and then export, the lines are much sharper.
I already tried a different export format, different dpi (max 1000) and changing the figure position to a higher zoom level.
Any idea on how to improve the export quality?
figure;
imshow(dicomData, [], ‘InitialMagnification’, ‘fit’);
title(sprintf(‘segmentation %s’, fileTitle), ‘Interpreter’, ‘none’);
hold on;
visboundaries(signalRoiMask, ‘Color’, ‘g’, ‘LineWidth’, 1);
visboundaries(lesionMask, ‘Color’, ‘m’, ‘LineWidth’, 1);
visboundaries(surroundingTissueMask, ‘Color’, ‘r’, ‘LineWidth’, 1);
visboundaries(phantomRoiMask, ‘Color’, ‘b’, ‘LineWidth’, 1);
viscircles(phantomCenter, phantomRadius, ‘EdgeColor’, ‘c’);
segmentationFile = fullfile(imageFolder, sprintf(‘segmentation_%s.png’, fileTitle));
print(‘-dpng’, segmentationFile, ‘-r600’);Hi everyone,
I am working with MATLAB to generate images that include segmentation lines (using visboundaries and viscircles) drawn over images. However, when I export these images (using saveas or print), the lines are not rendered sharply. Instead, they are much thicker. If I change the LineWidth to something like 0.5 a “halo”/outline effect appears around them. Interestingly, when I zoom into the figure manually within MATLAB and then export, the lines are much sharper.
I already tried a different export format, different dpi (max 1000) and changing the figure position to a higher zoom level.
Any idea on how to improve the export quality?
figure;
imshow(dicomData, [], ‘InitialMagnification’, ‘fit’);
title(sprintf(‘segmentation %s’, fileTitle), ‘Interpreter’, ‘none’);
hold on;
visboundaries(signalRoiMask, ‘Color’, ‘g’, ‘LineWidth’, 1);
visboundaries(lesionMask, ‘Color’, ‘m’, ‘LineWidth’, 1);
visboundaries(surroundingTissueMask, ‘Color’, ‘r’, ‘LineWidth’, 1);
visboundaries(phantomRoiMask, ‘Color’, ‘b’, ‘LineWidth’, 1);
viscircles(phantomCenter, phantomRadius, ‘EdgeColor’, ‘c’);
segmentationFile = fullfile(imageFolder, sprintf(‘segmentation_%s.png’, fileTitle));
print(‘-dpng’, segmentationFile, ‘-r600’); Hi everyone,
I am working with MATLAB to generate images that include segmentation lines (using visboundaries and viscircles) drawn over images. However, when I export these images (using saveas or print), the lines are not rendered sharply. Instead, they are much thicker. If I change the LineWidth to something like 0.5 a “halo”/outline effect appears around them. Interestingly, when I zoom into the figure manually within MATLAB and then export, the lines are much sharper.
I already tried a different export format, different dpi (max 1000) and changing the figure position to a higher zoom level.
Any idea on how to improve the export quality?
figure;
imshow(dicomData, [], ‘InitialMagnification’, ‘fit’);
title(sprintf(‘segmentation %s’, fileTitle), ‘Interpreter’, ‘none’);
hold on;
visboundaries(signalRoiMask, ‘Color’, ‘g’, ‘LineWidth’, 1);
visboundaries(lesionMask, ‘Color’, ‘m’, ‘LineWidth’, 1);
visboundaries(surroundingTissueMask, ‘Color’, ‘r’, ‘LineWidth’, 1);
visboundaries(phantomRoiMask, ‘Color’, ‘b’, ‘LineWidth’, 1);
viscircles(phantomCenter, phantomRadius, ‘EdgeColor’, ‘c’);
segmentationFile = fullfile(imageFolder, sprintf(‘segmentation_%s.png’, fileTitle));
print(‘-dpng’, segmentationFile, ‘-r600’); visboundaries, export quality, matlab MATLAB Answers — New Questions