Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assigning unique file names within series #12

Open
fedorov opened this issue Sep 27, 2018 · 4 comments
Open

Assigning unique file names within series #12

fedorov opened this issue Sep 27, 2018 · 4 comments

Comments

@fedorov
Copy link
Contributor

fedorov commented Sep 27, 2018

It would be helpful if it was possible to automatically assign unique names to the sorted files in the bottom-level directory. InstanceNumber unfortunately is not always present. SOPInstanceUID is too long (which is related to a separate concern, since Windows users will quickly hit maximum path limit if using UIDs as directory components).

Would it make sense to have a mode where consecutive numbers are assigned to the files within the bottom level sorted directory?

@pieper
Copy link
Owner

pieper commented Sep 27, 2018

+1, yes, that makes sense!

Right now everything is data driven with the % characters as escape sequences around dictionary terms. Maybe we should define a different escape characters (perhaps #image# or #series#) with meanings like number of the file in the sequence, or the number of the series in the study since ImageNumber and SeriesNumber are required to be unique.

@fedorov
Copy link
Contributor Author

fedorov commented Sep 28, 2018

Maybe better have some kind of suffix to the tag name that would indicate that unique values of the tag at a given level should be replaced with consecutive numbers? That way the script could maintain mapping at runtime, and do quick lookup instead of checking multiple files or doing multiple iterations over content (e.g., to get the number of series in study).

@fedorov
Copy link
Contributor Author

fedorov commented Sep 28, 2018

Another feature/idea could be to have a suffix to make a hash over the value of a given tag, and then take some small fixed number of characters from the signature to serve as a "unique" name within the level.

@pieper
Copy link
Owner

pieper commented Oct 1, 2018

I like the idea of doing something automatic - what if at every level if you the target directory or file already exists then it starts autonumbering them. So you went to save image.dcm and it already existed you would rename the first one image-0000.dcm and then new one image-0001.dcm and then save them from there. The only drawback I see is that people might expect these to have been sorted e.g. by image position but they would not be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants