-
Notifications
You must be signed in to change notification settings - Fork 0
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
30 new export option .csv #58
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Main Review
Nice implementation! It's great that you were able to implement this so quickly even though you were sick!
Proposed changes
-
I agree with Jakob, an exception in case of a missing file would be a good idea. As of now, I get an error message if I try to use this feature without a picture loaded:
This doesn't really affect anything as far as I can see and the user probably won't notice it, but it is not ideal. -
I am also not quite happy with the shortcut, but I also can't really think of a better one, since "Ctrl+S" is already taken and "Ctrl+V" bears the same problem... Maybe a combination with Shift might be worth considering?
-
This was not part of the issue so I won't insist on this, but it might be better to ask if the user wants to replace the file before removing it.
Nitpicks
Some minor changes of comments (see individual comments).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approval
Thank you very much for implementing the changes!
Everything works perfectly: The error is displayed if no image is opened and the new shortcut is better and successfully creates a file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The button works and creates a file that lands in my Desktop, the appropriate messages are printed when saving a file or when this is not possible. The keyboard shortcut is also functional. Nothing to add, very nice job!!
resolves #30
Description
Files can now be exported as CSV files in the same directory through the new "Save Features as .csv" option in the "File" dropdown menu. The files keep their name and get the suffix "_cp_features.csv" added.
Changes
The files cellpose/gui/io.py, cellpose/gui/menus.py, cellpose/io.py were modified.
_save_features_csv(parent)
was added which callssave_features_csv(parent.filename
) if the dataset is two-dimensional (parent.NZ == 1) to save feature data in a CSV file. Otherwise, it outputs an error message.save_features_csv(file_name)
was created which creates or overwrites a CSV file named filename_cp_features.csv without saving content.shortcut: Ctrl+C
was created for this option.Testing
The function can be tested by uploading an image and then clicking Save Features as .csv in the File menu.
Notes
Asking the user if they really want to replace the file before removing it could be implemented in another issue.