# Disabling compression for all volumes (including segmentations)

**URL:** https://discourse.slicer.org/t/disabling-compression-for-all-volumes-including-segmentations/8569
**Category:** Support
**Created:** [September 25, 2019, 7:46pm UTC](https://discourse.slicer.org/t/disabling-compression-for-all-volumes-including-segmentations/8569 "2019-09-25T19:46:37Z")
**Posts on this page:** 3
**Page:** 1

<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: [September 25, 2019, 7:46pm UTC](https://discourse.slicer.org/t/disabling-compression-for-all-volumes-including-segmentations/8569/1 "2019-09-25T19:46:37Z")

</div>

I am trying to use the sample script [Documentation/Nightly/ScriptRepository - Slicer Wiki](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Change_default_file_type_for_nodes_.28that_have_never_been_saved_yet.29)

to disable compression for all volume types by putting this example to my .slicerrc.py

> #set the default volume storage to not compress by default  
> defaultVolumeStorageNode = slicer.vtkMRMLVolumeArchetypeStorageNode()  
> defaultVolumeStorageNode.SetUseCompression(0)  
> slicer.mrmlScene.AddDefaultNode(defaultVolumeStorageNode)  
> logging.info(“Volume nodes will be stored uncompressed by default”)

But this doesn’t disable compression for segmentation nodes (download MrHead.nrrd, create a segment and see in the save as dialog box that while compression is unchecked for MRHead.nrrd, it is still enabled for \_seg.nrrd segmentation volume).

There is another snippet that disables compression specifically for segmentations,

> #set the default volume storage to not compress by default  
> defaultVolumeStorageNode = slicer.vtkMRMLSegmentationStorageNode()  
> defaultVolumeStorageNode.SetUseCompression(0)  
> slicer.mrmlScene.AddDefaultNode(defaultVolumeStorageNode)  
> logging.info("Segmentation nodes will be stored uncompressed

But I want to do it for both volumes and segmentation, is that possible?

---

<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: [September 25, 2019, 7:48pm UTC](https://discourse.slicer.org/t/disabling-compression-for-all-volumes-including-segmentations/8569/2 "2019-09-25T19:48:35Z")

</div>

Yes, of course, you can define default nodes for any number of node types.

---

<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: [September 25, 2019, 8:01pm UTC](https://discourse.slicer.org/t/disabling-compression-for-all-volumes-including-segmentations/8569/3 "2019-09-25T20:01:09Z")

</div>

Yes, actually just including both snippets in the same .slicerrc.py worked. I thought the second setting defaultVolumeStorageNode a second time would overwrite. But works great.
