mhe / pynrrd

Simple pure-python module for reading and writing nrrd files.
https://pynrrd.readthedocs.io/
MIT License
116 stars 51 forks source link

Modify 'data file' whenever detached_header=True #96

Closed tashrifbillah closed 5 years ago

tashrifbillah commented 5 years ago

We should omit the if-else below: https://github.com/mhe/pynrrd/blob/master/nrrd/writer.py#L190

Omitting the condition should also address the TODO below: https://github.com/mhe/pynrrd/blob/master/nrrd/writer.py#L210

I experienced this while modifying an NHDR and saving it as another NHDR. In this case, the modified detached data is not saved where my modified NHDR is.

Correction: Detached data is saved in the working directory.

addisonElliott commented 5 years ago

👍 I agree after thinking about your use case. I think it's safe to always overwrite the path for the data filename and update it.

This would be good to document (in the docs). Additionally, would be good to have a test for this. Maybe even take your use case and demonstrate how it causes problems.

tashrifbillah commented 5 years ago

Assign: @tashrifbillah