# Data file information

**URL:** <https://discourse.slicer.org/t/data-file-information/44274>\
**Category:** Support\
**Created:** [August 29, 2025, 9:46pm UTC](https://discourse.slicer.org/t/data-file-information/44274 "2025-08-29T21:46:16Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![michaelli](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/michaelli/32/67910_2.png) [@michaelli](https://discourse.slicer.org/u/michaelli)\
**Post date:** [August 29, 2025, 9:46pm UTC](https://discourse.slicer.org/t/data-file-information/44274/1 "2025-08-29T21:46:16Z")

</div>

I load a bunch of data files into Slicer 3D, including DICOM, STL and others, how can I get the file path and file name information? I cannot see the file information from data structure. I ask this because I have files with the same name from different folders. I’m confused and don’t remember if I loaded the file from the right folder. I want to double-check that.

---

<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 29, 2025, 9:49pm UTC](https://discourse.slicer.org/t/data-file-information/44274/2 "2025-08-29T21:49:01Z")

</div>

If you bring up the save dialog the default save will be the directory you loaded from.

---

<div class="post-metadata">

**Author:** ![michaelli](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/michaelli/32/67910_2.png) [@michaelli](https://discourse.slicer.org/u/michaelli)\
**Post date:** [August 29, 2025, 9:55pm UTC](https://discourse.slicer.org/t/data-file-information/44274/3 "2025-08-29T21:55:24Z")

</div>

Thanks for the tip. Yes, that will tell most of the file path, but I cannot see the DICOM file path. I’m wondering if there is other ways to view the file information easily.

---

<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 30, 2025, 4:39pm UTC](https://discourse.slicer.org/t/data-file-information/44274/4 "2025-08-30T16:39:37Z")

</div>

You can get that using a little script, something like this: [https://slicer.readthedocs.io/en/latest/developer\_guide/script\_repository.html#access-tag-of-a-scalar-volume-loaded-from-dicom](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#access-tag-of-a-scalar-volume-loaded-from-dicom)

---

<div class="post-metadata">

**Author:** ![michaelli](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/michaelli/32/67910_2.png) [@michaelli](https://discourse.slicer.org/u/michaelli)\
**Post date:** [August 30, 2025, 5:10pm UTC](https://discourse.slicer.org/t/data-file-information/44274/5 "2025-08-30T17:10:24Z")

</div>

```auto
> def pathFromNode(node):
> storageNode = node.GetStorageNode()
> if storageNode is not None: # loaded via drag-drop
> filepath = storageNode.GetFullNameFromFileName()
> else: # Loaded via DICOM browser
> instanceUIDs = node.GetAttribute(“DICOM.instanceUIDs”).split()
> filepath = slicer.dicomDatabase.fileForInstance(instUids\[0\])
> return filepath
> node = slicer.util.getNode(“2025data”)
> path = self.pathFromNode(node)
> print(“DICOM path=%s” % path)

```

NameError: name ‘self’ is not defined

Did I miss something?

---

<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 30, 2025, 5:46pm UTC](https://discourse.slicer.org/t/data-file-information/44274/6 "2025-08-30T17:46:32Z")

</div>

> [@michaelli](#):
>
> `> path = self.pathFromNode(node)`

You only use `self` when you are in a class method. Here you can just call `pathFromNode`. Otherwise it looks reasonable.

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [September 1, 2025, 9:06am UTC](https://discourse.slicer.org/t/data-file-information/44274/7 "2025-09-01T09:06:50Z")

</div>

This may be a resonable piece of information to include in the subject hierarchy tooltip. I could add it in the base class (if a node has a storage node with a valid URL, add it to the tooltip). @pieper what do you think?

---

<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:** [September 1, 2025, 1:31pm UTC](https://discourse.slicer.org/t/data-file-information/44274/8 "2025-09-01T13:31:43Z")

</div>

> [@cpinter](#):
>
> information to include in the subject hierarchy tooltip

I think that’s a great idea 👍

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [September 2, 2025, 1:43pm UTC](https://discourse.slicer.org/t/data-file-information/44274/9 "2025-09-02T13:43:41Z")

</div>

I created a PR for this:

> <https://github.com/Slicer/Slicer/pull/8690>
>
> Re https://discourse.slicer.org/t/data-file-information/44274/8
> 
> As discussed …in the above forum topic, I added a small feature that shows the file path each node is loaded from (if loaded from file and its storage node contains a path). These types of nodes support this feature for now:
> 
> Volume:
> \<img width="416" height="83" alt="image" src="https://github.com/user-attachments/assets/86c03725-7b63-451c-9a13-503f0bc15e72" /\>
> 
> Model:
> \<img width="516" height="77" alt="image" src="https://github.com/user-attachments/assets/74227078-100a-4796-905e-e716a6113fcd" /\>
> 
> Segmentation
> \<img width="760" height="65" alt="image" src="https://github.com/user-attachments/assets/6ebb4637-800e-4f17-a31d-3fa507ab4c07" /\>
> 
> Table
> \<img width="292" height="68" alt="image" src="https://github.com/user-attachments/assets/3ede3cec-b3c3-4271-a908-ab1b03e31e06" /\>
> 
> Markup
> \<img width="216" height="69" alt="image" src="https://github.com/user-attachments/assets/0133b063-99e3-466c-8777-eeae9803f8a3" /\>
> 
> Transform
> \<img width="465" height="142" alt="image" src="https://github.com/user-attachments/assets/1d1a98d6-8808-4291-bc88-7ca7e7be9d5c" /\>
