[Kst] Loading images
nicolas.brisset at free.fr
nicolas.brisset at free.fr
Mon May 31 23:36:30 CEST 2010
> Its perhaps an oversite. If it looks like it would be easy from a
> point of view to add matrixes + images without making vectors + curves
> then it would be a good thing to do. Lets come up with a description
> of how
> it should work.
The datawizard is definitely one of the killer features of kst, but right now it definitely supports only vectors. Creating new scalars, strings or matrices from datasources can be done from the data manager (which many users don't really use so much) or from the selection combo boxes in various dialogs, which is even more unlikely to be found. So I'd definitely advocate introducing the possibility into the datawizard.
Now, before I explain how I imagine it, one point needs to be made clear: there are objects which make sense as more than one primitive type. For example, images as vectors (to compute a histogram) or as matrices. Other example : matrices as a list of vectors (as requested and implemented recently for kst1 by Tom Downes) or as matrices. That may result in some confusion, so we have to pay attention to that.
What I'd suggest is simply adding a combobox in the second page at the top left (just above the search field) with a text label "Data type" and the following choices:
- Scalars ([nb of scalars])
- Vectors ([nb of vectors])
- Matrices ([nb of matrices])
- Strings ([nb of strings])
When no data of a given type has been found (because the datasource does not support it, or because there weren't any in the file) we should disable the entry. Default would be vectors, which is probably the most usual and to avoid confusing users. Or maybe the last used type could be remembered, and pre-selected if there is > 0 objects of that type.
Once the type is selected, the corresponding names would be shown in the list of available data and could be selected as usual.
As the next wizard pages will depend on the selected type (strings and scalars: just add - matrices: matrix dialog and then image dialog), we would allow selecting only objects of the same type. When the user changes types with a non-empty list of selected variables he should get a warning that the selection will be cleared if he continues. I think in practice this limitation is easy to understand and live with.
Then according to the type of object selected, the next pages shown would vary as listed above.
Open question I have in mind (but there may be more): should per-primitive scalars or strings be listed along with global scalars and strings, or just be loaded along with the corresponding objects. I'd tend for the second option, but I'm not 100% sure.
OK, I will stop there, hoping that this is somehow understandable. Otherwise don't hesitate to ask for clarifications or make counter-proposals.
> In the meantime, I create images from ->new image from the menu.
Cool, I've been able to load an image for the first time :-) And I stumbled upon the following bug: images don't always get updated. Change from color map to contour map for instance and hit apply: nothing happens. But if you zoom on the image or resize the window, it changes => missing call to update() somewhere?
P.S.: from my first experiments with some CDF files, we still need to add string support (global string attributes) and per-primitive strings and scalars (variable attributes), but it is starting to look real good. And there is also something to discuss about matrices (if you take files like http://www.unidata.ucar.edu/software/netcdf/examples/tos_O1_2001-2002.nc, it does not list any matrices because each variable of an appropriate type is actually a series of matrices and the dialog allows to select submatrices (with an awkward frame terminology) but not a single matrix in the series. Dimensions are probably 3 in that case, so they don't get listed. But one of the dimensions has size "unlimited" i.e. is time and should probably not be counted. But that's enough subject for another post...
More information about the Kst