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

Add a function of saving file as Gatan's dm3/dm4 file #92

Open
Leexulingyi opened this issue Mar 10, 2023 · 6 comments
Open

Add a function of saving file as Gatan's dm3/dm4 file #92

Leexulingyi opened this issue Mar 10, 2023 · 6 comments

Comments

@Leexulingyi
Copy link

Describe the functionality you would like to see.

Why Gatan's dm3/dm4 write function is not completed since their read function is. Is feasible of adding it?
We're trying to develop the write function of Gatan's dm3/dm4 files, by reading the source code.
What kinds of problems will we face?

@jlaehne
Copy link
Contributor

jlaehne commented Mar 10, 2023

Gatan's format is an undocumented, binary format. Reading functionality was developed over the years by reverse engineering. However, as long as Gatan does not publish the specifications of their file format, these functions will never be complete and it will not be possible to provide writing to that file format. Besides the technical challenge, focus of the developers will always be in support for writing to open formats that can be more widely used.

However, if you want to transfer data from python/HyperSpy to DigitalMicrograph, there is a number of strategies based on open formats documented in the user guide: https://rosettasciio.readthedocs.io/en/latest/interoperability.html So there should be no need to implement a file writer.

@CSSFrancis
Copy link
Member

CSSFrancis commented Mar 10, 2023

Nion Swift does read and write dm3 file formats. Their code is all open source so if you are interested in adding the ability to write to dm3 here then you certainly can! We could probably also improve our dm3 reader by copying theirs.

Their code for reading and writing dm3 and dm4 is pretty much complete so we would just have to copy the schema into rossetasciio.

@hakonanes
Copy link
Contributor

hakonanes commented Mar 10, 2023

We could probably also improve our dm3 reader by copying theirs.

There has been some talk in issues about using a more permissive license than GPL for parts of HyperSpy. Don't know whether anything of the current DM3 plugin is derived from work under a GPL license, but if not, and there is serious interest in moving towards a more permissive license, it might be undesirable to force a GPL license on the current plugin by updating it by looking at Nion Swift. Something to be aware of.

@CSSFrancis
Copy link
Member

CSSFrancis commented Mar 10, 2023

Here is the actual repo if you want to look at it. It has a Apache2.0 license which doesn't really mean much to me. If we use their schema but then write our own code is that acceptable? I'm not sure how this exactly works.

Edit: I think after reading more into licenses than I was expecting to this morning that means we can do whatever we want with the code, even copy/paste it into rosettasciio. So this would be the place to start! (Correct me if I am wrong...)

@hakonanes
Copy link
Contributor

hakonanes commented Mar 10, 2023

People in this Stack Overflow thread claim the Apache 2.0 license is compatible with more permissive licenses like BSD/MIT. However, SciPy (BSD) does not accept code that is derived from Apache licensed code. So I'm not sure. And sorry, I only looked at the Nion Swift library (GPL) and assumed wrongly the plugin was then GPL.

Edit: To clarify, it's OK to release Apache derived code under a GPL license.

@CSSFrancis
Copy link
Member

People in this Stack Overflow thread claim the Apache 2.0 license is compatible with more permissive licenses like BSD/MIT. However, SciPy (BSD) does not accept code that is derived from Apache licensed code. So I'm not sure. And sorry, I only looked at the Nion Swift library (GPL) and assumed wrongly the plugin was then GPL.

I was on github mobile so I couldn't find where Nion actually had their i-o code so my first link wasn't very helpful :) The Apache 2.0 license has stricter language regarding patent infringement and offers slightly better protection there which makes sense why Nion chose it. It does say that it isn't strictly compatible with BSD.

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

No branches or pull requests

5 participants