# Sorting data by type and name in Scene

**URL:** https://discourse.slicer.org/t/sorting-data-by-type-and-name-in-scene/34499
**Category:** Support
**Tags:** scene, data-loading
**Created:** [February 23, 2024, 3:10pm UTC](https://discourse.slicer.org/t/sorting-data-by-type-and-name-in-scene/34499 "2024-02-23T15:10:07Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![S\_Motch\_Perrine](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/s_motch_perrine/32/81028_2.png) [@S\_Motch\_Perrine](https://discourse.slicer.org/u/S_Motch_Perrine)
#### Post date: [February 23, 2024, 3:10pm UTC](https://discourse.slicer.org/t/sorting-data-by-type-and-name-in-scene/34499/1 "2024-02-23T15:10:07Z")

</div>

I have a large number of files in my Scene, and would like to have them ordered by name. I’m sure there’s got to be a way to do this quickly, but I either can’t remember or find it quickly. Example… my files are all named like this and I would like them to appear in sequential order: Bone\_001, Bone\_002, etc. but they were loaded in an order so they appear in Scene in a different order, such as Bone\_004, Bone\_001, etc. I have some models and some markups. How do I sort my data within the scene by type and file name? Thanks.

---

<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 23, 2024, 3:15pm UTC](https://discourse.slicer.org/t/sorting-data-by-type-and-name-in-scene/34499/2 "2024-02-23T15:15:24Z")

</div>

Currently you can drag and drop them in the Data module into the order you want, but I’m sure you could also resort them with a python script. I don’t think we have any other GUI method for that right now.

---

<div class="post-metadata">

### Author: ![S\_Motch\_Perrine](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/s_motch_perrine/32/81028_2.png) [@S\_Motch\_Perrine](https://discourse.slicer.org/u/S_Motch_Perrine)
#### Post date: [February 23, 2024, 3:23pm UTC](https://discourse.slicer.org/t/sorting-data-by-type-and-name-in-scene/34499/3 "2024-02-23T15:23:06Z")

</div>

Thanks. I think it would be a very useful feature to be able to sort the data by type (i.e. planes, points, curves, models, volumes, etc.) in addition to by name.

---

<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 23, 2024, 3:31pm UTC](https://discourse.slicer.org/t/sorting-data-by-type-and-name-in-scene/34499/4 "2024-02-23T15:31:44Z")

</div>

Yes, that makes good sense. You could add this to the feature requests area and people can vote for it. This would be a good topic for a new developer since the implementation would be pure Qt and could be implemented as a python plugin.

> **[Feature requests](https://discourse.slicer.org/c/support/feature-requests/9)**
>
> This category is for submitting ideas about what enhancements or new features should be added to 3D Slicer. Make your voice heard by voting on feature requests - by opening the topic and clicking the Vote button or by creating a new topics. Slicer developers will make it a priority to work on feature requests that have more votes.

---

<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 23, 2024, 4:33pm UTC](https://discourse.slicer.org/t/sorting-data-by-type-and-name-in-scene/34499/5 "2024-02-23T16:33:04Z")

</div>

> [@S\_Motch\_Perrine](#):
>
> How do I sort my data within the scene by type and file name? Thanks.

I am not sure if sorting is going to help you that much. I would suggest using the hierarchies. For example you can create a subject folder called Bone\_001 and everything related to that (volumes, markups, segmentations, etc) would be nested under that.

You can even make Slicer save preserving that folder structure on the disk.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/b/3/b3cbc7dddd1fd06b070c72b985c0028e2c4ba5ac.png)

Would that help?

---

<div class="post-metadata">

### Author: ![S\_Motch\_Perrine](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/s_motch_perrine/32/81028_2.png) [@S\_Motch\_Perrine](https://discourse.slicer.org/u/S_Motch_Perrine)
#### Post date: [February 23, 2024, 4:46pm UTC](https://discourse.slicer.org/t/sorting-data-by-type-and-name-in-scene/34499/6 "2024-02-23T16:46:06Z")

</div>

Thanks, Murat. I do use this feature sometimes, but there are times when I want to sort specifically by file type - which is then buried within the folders. For me, personally, I still want to be able to sort by file type and file names, although the folder feature is useful for some things, too.

---

<div class="post-metadata">

### Author: ![S\_Motch\_Perrine](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/s_motch_perrine/32/81028_2.png) [@S\_Motch\_Perrine](https://discourse.slicer.org/u/S_Motch_Perrine)
#### Post date: [February 23, 2024, 4:49pm UTC](https://discourse.slicer.org/t/sorting-data-by-type-and-name-in-scene/34499/7 "2024-02-23T16:49:40Z")

</div>

One way around this may be something else I wasn’t thinking of at first… Is there a way to easily export all of the measurements (along with their file names) for all curves, lines, etc. in a scene?

---

<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 23, 2024, 5:15pm UTC](https://discourse.slicer.org/t/sorting-data-by-type-and-name-in-scene/34499/8 "2024-02-23T17:15:31Z")

</div>

> [@S\_Motch\_Perrine](#):
>
> a way to easily export all of the measurements (along with their file names) for all curves, lines, etc. in a scene?

If you make a folder in the scene and put all your markups under there, you can right click and choose Export File. It will export all of them as mrk.json. using their node names as file names.
