# BUG while saving data as bundle with no segments

**URL:** <https://discourse.slicer.org/t/bug-while-saving-data-as-bundle-with-no-segments/34148>\
**Category:** Development\
**Tags:** segmentation, dicom\
**Created:** [February 5, 2024, 5:52am UTC](https://discourse.slicer.org/t/bug-while-saving-data-as-bundle-with-no-segments/34148 "2024-02-05T05:52:18Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![MJamal](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@MJamal](https://discourse.slicer.org/u/MJamal)\
**Post date:** [February 5, 2024, 5:52am UTC](https://discourse.slicer.org/t/bug-while-saving-data-as-bundle-with-no-segments/34148/1 "2024-02-05T05:52:18Z")

</div>

Hello @lassoan @jcfr @pieper @jamesobutler,

I loaded sample data with no segments and then saved it as a bundle.

Next time when i load the bundled file and try to add my first segment the effects does not seem to work. Here’s an image that shows i am not able to adjust threshold value as they appear disabled.

The threshold slider is neither sliding nor the spinner values:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/5/7/57e1710bd2ceba2948b85900c58360d7079bf04d.png)

I want to know if this is a bug or something else?

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [February 5, 2024, 12:55pm UTC](https://discourse.slicer.org/t/bug-while-saving-data-as-bundle-with-no-segments/34148/2 "2024-02-05T12:55:43Z")

</div>

Could be a bug. Can you share an mrb that shows this problem on SampleData along with a step-by-step description of what you did to create it? Also report what Slicer version you used.

---

<div class="post-metadata">

**Author:** ![MJamal](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@MJamal](https://discourse.slicer.org/u/MJamal)\
**Post date:** [February 5, 2024, 1:54pm UTC](https://discourse.slicer.org/t/bug-while-saving-data-as-bundle-with-no-segments/34148/3 "2024-02-05T13:54:24Z")

</div>

Sure, here are the steps I followed:

1. Navigate to File → Download Sample Data → MRHead.
2. After downloading, simply press `Ctrl+S` to save the scene as an mrb bundle without making any further changes.
3. Go to File → Close Scene.
4. Then go to File → Add Data → Choose file(s) to add and load the previously saved mrb file.
5. Proceed to the Segment Editor, add one or more segments, and then navigate to the Threshold effect.
6. Attempt to change the threshold range; you will notice that it won’t work.

Slicer version: `5.6.1 r32438 / 117ce5f`

Here’s the mrb file for your reference:

> **[2024-02-05-Scene.mrb](https://drive.google.com/file/d/1bcMe9PCtSvt6SZk5ztp1sFfQvznPE2bP/view?usp=sharing)**
>
> Google Drive file.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [February 5, 2024, 4:40pm UTC](https://discourse.slicer.org/t/bug-while-saving-data-as-bundle-with-no-segments/34148/4 "2024-02-05T16:40:08Z")

</div>

I don’t think this has anything to do with bundle.

When the two sliders overlap (in your case they were both set to 78), they are hard to move around (because you don’t know which one is which). I would suggest typing value in the intensity field in one of the field to move them apart, and then you should be able to move them independently.

Otherwise, everything works as expected for me.

---

<div class="post-metadata">

**Author:** ![MJamal](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@MJamal](https://discourse.slicer.org/u/MJamal)\
**Post date:** [February 6, 2024, 1:10am UTC](https://discourse.slicer.org/t/bug-while-saving-data-as-bundle-with-no-segments/34148/5 "2024-02-06T01:10:23Z")

</div>

> [@muratmaga](#):
>
> I don’t think this has anything to do with bundle.

This occurs only when attempting to load a bundle that has no segments.

> [@muratmaga](#):
>
> I would suggest typing value in the intensity field in one of the field to move them apart, and then you should be able to move them independently.

Is changing the value in the intensity field effective for you? On my end, it doesn’t seem to work. I’ve attempted to modify the value, but it remains unchanged.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [February 6, 2024, 2:34am UTC](https://discourse.slicer.org/t/bug-while-saving-data-as-bundle-with-no-segments/34148/6 "2024-02-06T02:34:19Z")

</div>

> [@MJamal](#):
>
> This occurs only when attempting to load a bundle that has no segments.

This is what I get, following your instructions:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/6/4/64e5f60e2c90ec55ddf3acf980efb9d613ef8047.jpeg).

So all looks good to me.

> [@MJamal](#):
>
> Is changing the value in the intensity field effective for you?

Yes, you should be able to type in a value directly into the  
threshold range boxes.

---

<div class="post-metadata">

**Author:** ![MJamal](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@MJamal](https://discourse.slicer.org/u/MJamal)\
**Post date:** [February 6, 2024, 4:38am UTC](https://discourse.slicer.org/t/bug-while-saving-data-as-bundle-with-no-segments/34148/7 "2024-02-06T04:38:11Z")

</div>

Sorry, I forgot to mention one more step, which is to save the bundle while the segment editor module is open.

I have attached a video for your reference:

> **[slicer.mp4](https://drive.google.com/file/d/1tyr15I-fqalwKyngdpUph0i1hq9-lcDI/view?usp=sharing)**
>
> Google Drive file.

---

<div class="post-metadata">

**Author:** ![MJamal](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@MJamal](https://discourse.slicer.org/u/MJamal)\
**Post date:** [February 7, 2024, 8:30am UTC](https://discourse.slicer.org/t/bug-while-saving-data-as-bundle-with-no-segments/34148/8 "2024-02-07T08:30:44Z")

</div>

@muratmaga @pieper,

Could you please confirm whether this is a bug or not?

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [February 7, 2024, 7:52pm UTC](https://discourse.slicer.org/t/bug-while-saving-data-as-bundle-with-no-segments/34148/9 "2024-02-07T19:52:03Z")

</div>

Yes, it sounds like a bug and should be filed. Saving and restoring with the segment editor open sounds like a valuable clue. You can file it at [Issues · Slicer/Slicer · GitHub](https://github.com/Slicer/Slicer/issues) and add a link to this discussion.

@lassoan hasn’t commented here yet, but he’ll probably want to have a look.

---

<div class="post-metadata">

**Author:** ![MJamal](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@MJamal](https://discourse.slicer.org/u/MJamal)\
**Post date:** [February 12, 2024, 11:33am UTC](https://discourse.slicer.org/t/bug-while-saving-data-as-bundle-with-no-segments/34148/10 "2024-02-12T11:33:19Z")

</div>

@pieper I’ve filed the issue. See [https://github.com/Slicer/Slicer/issues/7576](https://github.com/Slicer/Slicer/issues/7576).

---

<div class="post-metadata">

**Author:** ![MJamal](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@MJamal](https://discourse.slicer.org/u/MJamal)\
**Post date:** [February 28, 2024, 5:53am UTC](https://discourse.slicer.org/t/bug-while-saving-data-as-bundle-with-no-segments/34148/11 "2024-02-28T05:53:10Z")

</div>

@pieper @lassoan  
Any update on this issue?

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [February 28, 2024, 1:22pm UTC](https://discourse.slicer.org/t/bug-while-saving-data-as-bundle-with-no-segments/34148/12 "2024-02-28T13:22:39Z")

</div>

The issue was that you cannot write an image file without voxel data, so an 1x1x1 array was used as image data, but when that segmentation was loaded then the extent was set to that single voxel.

I implemented a fix, just have not yet submitted the pull request.

---

<div class="post-metadata">

**Author:** ![MJamal](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@MJamal](https://discourse.slicer.org/u/MJamal)\
**Post date:** [March 14, 2024, 4:34am UTC](https://discourse.slicer.org/t/bug-while-saving-data-as-bundle-with-no-segments/34148/13 "2024-03-14T04:34:09Z")

</div>

Understood.  
Thanks for the update 🙏
