Sorting data by type and name in Scene

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.

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.

1 Like

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.

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.

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.

Would that help?

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.

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?

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.

1 Like