# Function slicer.util.loadVolume does not accept periods in the filename

**URL:** https://discourse.slicer.org/t/function-slicer-util-loadvolume-does-not-accept-periods-in-the-filename/19177
**Category:** Development
**Created:** [August 12, 2021, 10:50pm UTC](https://discourse.slicer.org/t/function-slicer-util-loadvolume-does-not-accept-periods-in-the-filename/19177 "2021-08-12T22:50:52Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![giovform](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/giovform/32/4687_2.png) [@giovform](https://discourse.slicer.org/u/giovform)
#### Post date: [August 12, 2021, 10:50pm UTC](https://discourse.slicer.org/t/function-slicer-util-loadvolume-does-not-accept-periods-in-the-filename/19177/1 "2021-08-12T22:50:52Z")

</div>

If the file has a period in its name, e.g. **word1.word2.tif** , then the loaded volume using **slicer.util.loadVolume** function will have its name as just **word1**.

Is this intended?

Tested on 4.11.20210226 r29738.

---

<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: [August 13, 2021, 4:33am UTC](https://discourse.slicer.org/t/function-slicer-util-loadvolume-does-not-accept-periods-in-the-filename/19177/2 "2021-08-13T04:33:03Z")

</div>

When you load a file using the GUI then there is a mechanism that strips known file extensions for the selected reader and allows the user to edit it before loading.

If you load a node programmatically then a simpler mechanism is used that removes the complete file extension.

If you want to remove only the longest _known_ file extension then you can use the storage node’s `GetFileNameWithoutExtension()` method:

```python
volumeNode = slicer.util.loadVolume(r'c:\tmp\word1.word2.tif')
volumeNode.SetName(volumeNode.GetStorageNode().GetFileNameWithoutExtension())

```
