# .mrb optimization (file size and loading time)

**URL:** <https://discourse.slicer.org/t/mrb-optimization-file-size-and-loading-time/31177>\
**Category:** Support\
**Created:** [August 16, 2023, 4:38pm UTC](https://discourse.slicer.org/t/mrb-optimization-file-size-and-loading-time/31177 "2023-08-16T16:38:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Deep\_Learning](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/deep_learning/32/15345_2.png) [@Deep\_Learning](https://discourse.slicer.org/u/Deep_Learning)\
**Post date:** [August 16, 2023, 4:38pm UTC](https://discourse.slicer.org/t/mrb-optimization-file-size-and-loading-time/31177/1 "2023-08-16T16:38:23Z")

</div>

I have been using a merged segmentation/volume sequence and saving it as .mrb.  
Works great… drag and drop…  
Basiclly 20 volumes and segmentations: 512x512x320x20.

Any tips on optimization for file size (now 3.1 Gb) and loading time (3 min).

Cropping will work. Files seem well compressed.  
I’m not sure what precision the masks and volumes are being stored with…

Any tips would be greatly appreciated.

---

<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:** [August 16, 2023, 5:14pm UTC](https://discourse.slicer.org/t/mrb-optimization-file-size-and-loading-time/31177/2 "2023-08-16T17:14:48Z")

</div>

If you save as mrml instead of mrb and you can uncheck the compress option for saving volumes. It will take more disk space but the load/save times should be much faster. It’s not much harder to manage a directory of the files with the mrml file than it is to manage the mrb.

---

<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:** [August 16, 2023, 5:16pm UTC](https://discourse.slicer.org/t/mrb-optimization-file-size-and-loading-time/31177/3 "2023-08-16T17:16:26Z")

</div>

> [@Deep\_Learning](#):
>
> Any tips on optimization for file size (now 3.1 Gb) and loading time (3 min).

Is there anyway to use lpzip instead of regular zip to package mrb? Parallelization will be great.  
[Plzip - A massively parallel lossless data compressor (nongnu.org)](https://www.nongnu.org/lzip/plzip.html)

But i just saw it is gpl.

---

<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:** [August 16, 2023, 5:24pm UTC](https://discourse.slicer.org/t/mrb-optimization-file-size-and-loading-time/31177/4 "2023-08-16T17:24:07Z")

</div>

Last time I looked there wasn’t a good parallel compression option, code was either GPL, like Plzip, or not cross platform.

If saving uncompressed doesn’t help enough and you are willing to do some python coding then doing something like saving and loading the volume sequences as zarr might be worth the (probably small) effort. Here’s an example down that path: [Display NGFF volume data in 3D Slicer · GitHub](https://gist.github.com/pieper/0e7edcf70c844925ea104e07aedbe92a)
