# Add a user warning prompt when NIfTI imported as a segment is not a binary mask

**URL:** <https://discourse.slicer.org/t/add-a-user-warning-prompt-when-nifti-imported-as-a-segment-is-not-a-binary-mask/27298>\
**Category:** Development\
**Tags:** segmentation, nifti\
**Created:** [January 17, 2023, 1:34pm UTC](https://discourse.slicer.org/t/add-a-user-warning-prompt-when-nifti-imported-as-a-segment-is-not-a-binary-mask/27298 "2023-01-17T13:34:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikbuch](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mikbuch/32/69022_2.png) [@mikbuch](https://discourse.slicer.org/u/mikbuch)\
**Post date:** [January 17, 2023, 1:34pm UTC](https://discourse.slicer.org/t/add-a-user-warning-prompt-when-nifti-imported-as-a-segment-is-not-a-binary-mask/27298/1 "2023-01-17T13:34:38Z")

</div>

Hi, I struggled a bit with importing NIfTI images as a segment (“Segmentation”) to the Slicer.

It took ma a while to realize that the image I was trying to import was not a binary mask (0s and 1s), but a probability map (values from 0 to 1).

When I tried to import a non-binary NIfTI image as a segment, I got the following results:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/8/3/83431281a0dacf98449c243fcb04c813bff5fc85.png)

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/6/b/6b43f4c2433bddb5b5229fdea05aa96bae2513c1.png)

(i.e., I couldn’t see the segment), and I got no information whatsoever may be not right with my image.

For the comparison, the Slicer view after uploading binarized NIfTI as a “Segmentation” – everything worked:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/6/5/65c3c0c427ee426e8a00862fd09123d939e77dc2.png)

I think it is a good idea to add a prompt/a warning saying:

> “Warning: The image you are trying to load as a segment has to be a binary map (i.e., it can contain only the values 0 and 1).”

What is your opinion on this subject?

Similar posts:

- [How to show the segmentation in segment editor which is loaded from a nii.gz file generated by other program?](https://discourse.slicer.org/t/how-to-show-the-segmentation-in-segment-editor-which-is-loaded-from-a-nii-gz-file-generated-by-other-program/13096)

- [Importing segmented MR image in NIfTI format to 3D](https://discourse.slicer.org/t/importing-segmented-mr-image-in-nifti-format-to-3d/11021)
