gregvonkuster / galaxy-csg

Galaxy tools for Constructive Solid Geometry
MIT License
5 stars 2 forks source link

Broken color surface field GUI #17

Closed pletzer closed 8 years ago

pletzer commented 8 years ago

When coloring a surface field, the two following gui entries

Field name Field component index

do not respond to the mouse. This behavior is both on the docker galaxy server and on http://galaxy-pedees.rhcloud.com.

--Alex

gregvonkuster commented 8 years ago

@pletzer We need to work more closely on changes made to the underlying icqsol package code because changes affect the Galaxy tools that use the package.

It looks like you've made changes to the code that produces our shape datasets. We used to have data that defined field names with lines like this: SCALARS surface_field double 2

Now we have data that defines field names like this: CELL_DATA 12 FIELD FieldData 1 surface_field 1 12 double

There is a lot of computation going on behind the scenes with these Galaxy tools. Metadata is generated as a component of the tool execution. The metadata generator inspects the dataset contents and sets defined metadata attributes for the dataset. The icqsol_add_surface_field_from_expression tool will generate a dataset that will no longer have correct metadata attributes for the dataset because it no longer defines the field names since it does not find this line: SCALARS surface_field double 2.

And since the surface fields are not included in the metadata for the dataset, the Field Name select list will not be populated in the icqsol_color_surface_field tool when it uses this dataset as input.

So it looks like I'll need to submit a PR to the Galaxy code base to enhance our metadata generator for these datasets. I assume that now I'll need to look for this line:

FIELD FieldData 1

And that the number 1 at the end of the line defines the number of field names associated with the dataset. Is this correct? If so, then I assume I will read this number of lines to get the field names where each line begins with the field name:

surface_field 1 12 double

Can you clarify if this is correct?

Do you know of other changes that have been or will be made to our datasets that will affect our metadata generator? I'd like to submit 1 PR for changes and enhancements if possible.

pletzer commented 8 years ago

Hi Greg,

I don't see any SCALARS in any of the output files from regression tests -- I'm not sure when SCALARS was dropped in favor of FIELDS (perhaps when trying to add support for multiple fields). Both can be used in principle but SCALARS require a lookup table. Is there anyway we can test if changes in icqsol affect galaxy-csg?

An example of vtk file with 3 fields is testBoltFineWithField3.vtk (array names are "ones", "wave" and "twos":

FIELD FieldData 3 ones 1 2323 double 1 1 1 1 1 1 1 1 1 ... wave 10 2323 double 0.444839 0.439924 0.435063 0.430255 0.425501 0.4208 0.41615 0.411552 0.407004 0.402507 0.0841559 0.083226 0.0823064 0.081397 0.0804976 0.0796081 0.0787285 0.0778585 ... twos 1 2323 double 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ....

gregvonkuster commented 8 years ago

@pletzer Testing can be performed with planemo, but it is not yet automatic since planemo is currently under significant development. Hopefully soon we can have it hooked up.

For now, manual testing using the Galaxy tools should be done when changes are made to icqsol. Tests would not take long - just create shape -> refine shape -> compose shapes -> add surface field -> color surface field using the output from the previous tool as the input to the next. This kind of testing would be less than 5 minutes and would have uncovered the broken tools.

pletzer commented 8 years ago

@gregvonkuster color surface field seems to be working now. Thanks.