Text archives Help
- From: Kristen Zygmunt <krismz@sci.utah.edu>
- To: seg3d@sci.utah.edu
- Subject: [Seg3D] Re: Re: Re: Re: loss of functionality? export segmentation to MetaImage format
- Date: Thu, 17 Sep 2009 15:35:26 -0600
On Sep 17, 2009, at 7:34 AM, Ramón Casero Cañas wrote:
Ramón Casero Cañas wrote:
In my opinion, it's useful to show all the formats in the drop-down
menu, because otherwise the user may get confused.
I agree to an extent. Seg3D uses the ITK file reader/writer for all
file I/O. ITK uses a factory-based approach so that the base ITK file
reader just queries its list of specific file readers asking each of
them in turn whether they know how to read the given file. This is
nice from ITK's perspective in that it means ITK does not need to keep
and update a central list of all known supported filetypes. An ITK
user could easily extend ITK by supplying a new reader without having
to modify existing ITK code. This makes it harder to provide a
comprehensive list of all supported filetypes in Seg3D. What I can do
is extend the default list to at least match the list of import types.
For instance, Gimp, the image editor, does that. By default, "All
images" is the option presented
If you give a name with a particular extension, the extension is
checked. If the extension is not recognised, then you get an error
dialog:
"The given filename does not have any known file extension. Please
enter a known file extension or select a file format from the file
format list".
The drop down menu presents a (rather long) list with all formats
Gimp can save to.
I can change so that the default type is All files, so that if the
user wants to change the extension from the default filename(which is
still .nrrd), they can either type it in or select the appropriate
type from the drop down menu. A default file extension needs to be
provided because ITK does not know how to write to a file with no
extension. I believe the user needs to be able to press enter when
the save dialog first pops up and have the save work successfully with
the defaults provided.
If an invalid file extension is provided, Seg3D will provide an option
to either select the .nrrd file type or cancel.
Oh, I forgot. In Gimp, if you select one format with the drop down
menu (e.g. XCF), but then you write the filename with another
extension, e.g. example.jpg, the text box overrides the drop down
menu, and the image will be saved as JPEG.
I have not checked photoshop yet for its implementation, but as far as
I can tell, the current behavior where the extension is enforced by
the file type selected by the user is consistent with user interface
style guidelines for both Mac and Windows. I can modify the display
in the wxWidgets dialog box I am using to better show this to the user
by having the file extension displayed. The wxWidgets dialog will
then show the change in extension as the different file types are
selected. However, the dialog will not update the displayed extension
if the user overwrites it manually even though the user-supplied
extension will be changed by the software. This behavior cannot be
changed without writing a custom dialog which is not desired at this
point since we are planning on switching to Qt shortly.
The main location for all of this interaction is in src/Applications/
Seg3D/Seg3DFrame.cc Search for export_formats_ and export_exts_ in
this file.
To try out the changes mentioned above, check out the most recent
revision from the release_4.2 branch (4.2 is the new version of SCIRun
where v1.12 of Seg3D lives)
svn checkout
https://code.sci.utah.edu/svn/cibc/cibc/branches/release_4.2/SCIRun
I hope this helps, please provide any feedback or questions you may
still have,
Kris
Archive powered by MHonArc 2.6.16.