Skip to content

BUG: Enable use of labelValue for output label map

A bug was introduced in svn 22211 [1] when the labelValue parameter in the ModelToLabelMap CLI was exposed to the interface. The erosion and dilation filters used in the code are binary ones and by default use the maximum of the data type of the label map, in this case hard coded to 255 for unsigned char. In order to do the full pipeline with the user selected label value, the code would need to be updated to use: erodeFilter->SetErodeValue(labelValue); dilateFilter->SetDilateValue(labelValue); A quicker fix is to adjust the output label map in the last step to set the desired label value, implemented in this patch.

Investigating this issue, the hard coded kernel size was set into a variable, in anticipation of exposing it via the XML (quick tests showed no visible difference).

Added a test and output using the label value 128. When run from the GUI, the model and volume were offset, so a transformed model was generated that overlaps the input volume and was used to generate the new baseline comparison volume. Removed unused baseline image.

[1] http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=22211

Issue #3233

Merge request reports

Loading