Letters appended to filenames?

Apologies if this topic has been addressed, I searched back several months but didn’t see anything regarding this. This is with Slicer preview 12-06 on Windows.

Filenames of certain files (MRML in particular) are being renamed and appended with 4 random characters - for example, Helogale parvula AMNH 88132.mrml is changed to Helogale parvula AMN_DKFE.mrml. This was not occurring in a preview from a few months back (09-30).

Did something change regarding auto-renaming of filenames or something? Again, apologies if I missed something, but a search of posts going back a bit didn’t reveal anything. I have not gone through a git log since then, so it’s entirely likely I missed this.

Any ideas? Thanks!!

Oh, never mind - I just saw this in the commit log.

commit 7438bf24f0cd0b6e220e97c398c4a2da0192357e
Author: Kyle Sunderland <sunderlandkyl@gmail.com> 
Date:   Thu Nov 14 15:42:17 2024 -0500

    BUG: Fix saving with long node names

You would not be able to reliably load or save a scene with long filenames on Windows, therefore we consistently limit the filename length that is generated from the node name by default on all platforms. This does not affect the node name, only the default filename that the node is saved to. We can still tweak the logic in case you have any specific suggestion.

It’s okay, it was just a slight surprise. I’ve not had issues with long filenames on windows; I wonder if it has something to do with filesystem choice? I had a discussion with colleagues recently on NTFS vs exFAT, etc. (I basically only use NTFS, and install a 3rd party NTFS driver on MacOS machines.) But this could have nothing to do with it whatsoever.

I do find the behavior a little curious, however. For example:

  1. Load in an NRRD file with a long filename
  2. Make a change to the node, for example, change the voxel size.
  3. Save the file. In the save dialog, the auto-generated filename with 4 random characters comes up.
  4. Override the filename with the original long filename. Slicer saves it to the long filename.
  5. Do some work, like make a segmentation, etc.
  6. Go to save. The volume node is unmodified, so it is not marked to be saved. However, the filename is not the long filename, it is an auto-generated filename with the 4 random chars. So it’s not saved (which is correct) but the filename does not match the file on disk.

I get what’s going on, and it’s okay, but it is a little confusing.

If we want to save and load scenes robustly then we need to limit file name length. Even if you happen to be able to save it on your current disk at the current location, you may run into issues when moving to another folder, want to copy it to a USB stick, want to open the files on a Windows computer, or want to cloud sync the folder.

Let us know if you have a better idea how to save nodes with very long names to short filenames (or if you encounter any issue, such as a scene is not saved or loaded correctly).

Sounds good, I’ll think about it. I do get the issue of portability; as I mentioned before we ran into that recently with a USB stick someone had that was formatted as exFAT or even FAT32.

Maybe an “allow long filenames” checkbox somewhere in preferences? This is probably too much complexity for a fairly innocuous issue, however.