-
Notifications
You must be signed in to change notification settings - Fork 51
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
Print relative data file name in the header #78
Comments
Yes, this sounds correct and matches the behavior of other readers. |
From the excerpt you quoted, it sounds like Current logic for
Probably 99% of the time you want a relative detached header so I understand this can be annoying. Another argument could be added to I don't want to break compatibility but my preference would be to set relative paths to true since that is used the most imo. |
I think you are talking about the
https://github.com/mhe/pynrrd/blob/master/nrrd/reader.py#L345 I am not arguing that However, Again, I don't see how we may break compatibility if we write relative header name instead of absolute header name (even when user specifies one). |
No, the reader logic should be correct. The write logic is what I'm referring to. I think I misinterpreted the excerpt you gave. I thought it was referring to the I think the best option would be to create an argument in |
So, if defaulting to relative path is not breaking the reading afterwards i.e.
do we need to add additional argument? Aren't we better off setting the 'data file' to relative path? |
I see what you're saying. Either way, absolute or relative paths, reading the NRRD will be fine assuming the paths are correct. It is up to the user whether they want to print out an absolute or relative path for the detached filename. Personally, I'm of the philosophy that if you have an option that you can foresee someone wanting to change it, then make it an option and leave it up to the user. I don't know a specific use case why someone would want to use an absolute path. |
Add argument `relative_data_path` to `nrrd.write` for specifying whether to save the 'data file' field in the header relative or absolute. Fixes #78
In the detached header, the data file name is printed with abspath. That means, if someone moves the data around, than data file location is invalid. Instead, how about we write the data file with basename?
https://github.com/mhe/pynrrd/blob/master/nrrd/writer.py#L186 and https://github.com/mhe/pynrrd/blob/master/nrrd/writer.py#L191
I think the specification also suggests that:
Suggestion:
Happy to submit a PR.
cc: @ihnorton
The text was updated successfully, but these errors were encountered: