Personal tools
You are here: Home / cmgui / Wiki / Shanes notes
Log in

Forgot your password?

Shanes notes

I try to announce work items by posting in the cmgui tracker.
I no longer work for the Bioengineering Institute, however I am actively
working on CMGUI and ZINC development for my new employer.
  • ** Things that I am working on **

  • ** Tasks that I have done since leaving. **

  • ** Tasks that I would like to have completed before I left **

    • Feedback or improve ITK AIX changes.

      To get ITK to compile on AIX I commented out lots of code related to output of parameters. I should find a better solution and/or communicate with the ITK developers.

    • Feedback libmesh changes.

      I have made changes to libmesh to support AIX. Some of these are not obvious how to make robust or conditional on just AIX. I need to begin a discussion with the libmesh developers about this.

    • Make updated releases of ZINC.

      Been working on support for OSX. This has nearly been completed but I haven't spent time on it lately. I merged my previous work with the latest zinc, now it needs building and testing.

    • Add testing to the Zinc based examples.

      This is still an outstanding and important task.

  • ** What I did before I left : 2007 **

    • Show Alan Wu cmiss systems

      Alan is going to be taking some responsibility for maintaining the build, testing and tracker systems. I need to teach him as much as possible about these systems and about the use and architecture of cmgui.

      Add cmgui-wx-debug-valgrind to testing.

      cmgui testing commands that I frequently use.

    • Embedded_image

      Wrote a new example for Vijay which embeds a texture as material points in a deforming mesh.

    • Wrote cmgui (fieldML) export for libmesh. Need to add an example.

    • zinc

      Make a new release. Trying to fix known problems and make things robust for a release.

    • Helping Alan to

      Add cmgui-wx-debug to testing.

    • Help with wx version

      The wx command window, graphics windows and scene editor are substantially complete. Alan is working on the node viewer.

    • Restructuring computed fields.

      Change computed_field_type_packages to be a reference_counted class so that we can allocate and clean them up correctly and not use global variables. So far I have identified 5 objectives. So that I actually complete the task I am trying to reach each objective separately. I have committed changes for objective 3 and objective 2.:

      1 Allow data types other than float.

      2 Convert the computed_fields to use a C++ object internally

      instead of faking methods with tables of virtual functions. (Which would greatly improve code for default functions and not defined functions).

      3 Use an object to represent the location at which a field is

      evaluated, so that most fields no longer need to know explicitly nodes and elements.

      4 Instead of define/list/command functions just set up a generic option

      table structure which characterises parameters and includes help. This can be used for setting commands, getting parameters and potentially for generating an interface.

      5 Including the manager in a field so that it can notify the manager

      when changes are made. Need to be careful with downstream fields that don't expect a field to be modified and making a field dependent on itself.

    • Add help for other commands, particularly the more perverse ones.

    • Tidying up. Made gtkmain the default and removed the mangling of the

      name. Changed the default target for zinc to automatically make the xpi.

    • Added a comment in the top level make file for "make clean" explaining

      what to do.

    • Added the ability to write help text into Option tables so that it is

      displayed with the ? and ?? operations. Also parse the help text into something useful on the commands web page. Added help for the compose computed field.

    • Spectra

      Fixed up the colour lookup tables to use linear textures rather than rasterising on a reduced colour range. Added a spectrum settings which uses the new evaluation of a field at another fields coordinates to calculate it's colour values. Used this setting to allow colour filtering in volume rendering. Wrote an example which uses an index encoded in the alpha channel to turn interactively turn pixels on or off when volume rendering.

    • fonts

      Added the ability to set font objects, allowing the default font to be changed. Used a manager underneath so that the editors could have choosers added. Allowed the specification of the font when creating a colour_bar.

    • list node

      gfx list node and gfx list element now write the number of items listed as well as the number ranges.

    • Image processing

      Allow consecutive computed_fields which use ITK filters to chain together so that there is a similar ITK pipeline. Allow computed fields to be evaluated at coordinates with respect to some field. This means that we no longer have to generate an element-xi location when just iterating over the pixels of an image saving computation.

    • zinc
      Released zinc-

      Updating examples to work with this. This version is not compatible with previous versions (zinc or mozcmgui). There is a script included with the source code to update from old versions (looking at using view svn to link to this here).

      Added support for bzip files across the network, used this for

      the endoscope_animation example. Added support for the emoter into zinc, enabling the emoter or boxfish example to animate. Got zinc to build in windows vmware.

    • mozCmgui.

      Rewritten mozCmgui without CORBA by implementing direct wrappers from XPCOM to the cmgui C api using a special version of xpidl to generate most of the code and some hand coding. Tried to maintain as backwards compatible interface as possible. Replaced the perl interpreter with a simple variable assignment and replacement only, nullInterpreter to remove dependencies and security risk. Changed the name back to ZINC. Built linux and win32 versions and resolved a bunch of issues due to running multiple times in the same process. Built a beta linux version and beta windows version I have now also built a prealpha version on Intel OSX. The main issues are with how a OSX does not have embedded windows. Many of the consequences I have resolved but currently switching tabs is still broken. The building of an OSX version has unfortunately required breaking the existing javascript interface. Supporting 64bit operating systems will also require a break to the interface as the current version relies on passing a pointer in a 32bit integer. Broken the interface majorly. Simplified the zinc application developer code a lot. Upgraded version to Written upgrade script for zinc developers although I'm sure it will fail in places.

    • api directory changes.

      Made some changes to the cmgui api directory to support the automatic generation of more of ZINC. Particuarly adding const to "in" strings. Rearranging structure of the enum names. Exposing some more functions that had been used directly from internally before.

    • Added rs6000-aix testing for libmesh examples.

    • Added an Enumerator_chooser class that uses a wxChoice for wx versions.

    • Helped Alan to:

      Run cmissmake and add bioeng46. Build cmgui-wx on bioeng46. Add cmgui-wx builds to AIX, x86_64 and Darwin.

    • Committed code changes to build cmgui-carbon, a version of the

      graphics_window using the carbon widgets on OSX. Added building of carbon versions to cmissmake.

    • Graphics window text for wxWidgets
      I have added support for text in the graphics window for the

      wxWidgets version, using only wxWidget functions. Maybe I should submit a proposed function for wxGLCanvas.

    • Added linux and win32 cmgui-wx builds to the standard build process.

    • Added an image_resample computed field which just changes the

      native_resolution passed on to subsequent fields. Most image_processing operations use this native_resolution.

    • Make gfx modify texture evaluate_image use the native_resolution of the

      source field as the default resolution for, specify_width, specify_height, specify_depth and texture_coordinate_field.

    • Removed global variables in computed fields and api/cmiss_scene_viewer.

    • Written choosers for wxWidgets version of cmgui as C++ templates so that

      we can build a fully functional user interface in wxWidgets.

    • Added win32 native dll's to the standard build process.

  • ** What I did : 2006 **

    • Made a release of mozCmgui (v0.4.1.5) to

    • Made a release of cmgui (v2.3.3) to

      sourceforge and our release centre

      Made a first go at a build script that includes all the

      third party sources for linux. Need to add support for multiple platforms, make it stop on failure and test it in a minimal development environment.

    • Shifted cmgui and mozCmgui to using a public subversion at

    • Improvements to spectra for colour maps.

      Need to get spectra to use computed_fields as otherwise we end up just making the same operations again. Also, the current spectrum settings overwrite the previous ones so you can't just accumulate effects, whereas computed fields would be cumulative. Need to look at using interpolated functions to get greater accuracy than the sampling resolution, however have to do some work with this to match intepolation between pixel centres with flat edges.

    • Improve the spectrum editor. I have decided to keep

      the settings structure internally as this makes sense for 2D transfer function patches. I think I will not use the curve editor, at least for simple mappings, but just allow points to be selected where you specify material properties. The primary objective is to allow editing of spectrums that are applied to surfaces and textures using texture maps and colour lookup tables so that they happen interactively. Decided to reinvestigate using wxWidgets to give us a cross platform widget set. A summer student is employed to help with this. As background to this I am reevaluating cross platform widget tookits. I am setting up a wxWidgets version of cmgui, using the xrc resource files compiled into the executable. The summer student has built a command window and is now working on the graphics window (and I have got a single scene viewer 3D window working).

    • We have an example for the eye model. Sally has added multiple textures

      and is now working on adding some simple dynamics.

    • Started integrating ITK into CMGUI.
      Mark is interested in using the Gaussian Image filter to calculate

      derivatives and the eigenvalues of the Hessian matrix.

      Will be getting some help to put some ITK image processing into the digitiser.

    • Update the xray view on the Hip Screw Simulator to use true bone

      density data.

    • Want non axes aligned planes in the digitiser.

    • Getting libmesh to compile on AIX and cygwin.

      I got libmesh to compile statically and serially with cygwin. I also tried with mingw and will have to write some code to support some thread functions used from POSIX. On AIX I have fixed a few problems, documented on Again I am linking statically to avoid the strange shared AIX libraries. Now I can run up to 60 shared memory MPI processes. Once the cluster is up should be able to reproduce that there too. Trying to build Hypre into Petsc for AIX and use that with libmesh. Trying to get 64bit on AIX. Trying to figure out a way to include AIX and loadleveler into our example testing framework.

  • ** What I did before that **

    • Added simulated depth_of_field controls to a scene_viewer.

    • xpcorba.

      Got Andrew to fix mozCmgui with the latest xpcorba. Seems to be working again now.

      Got a windows build running again. Released mozCmgui- The mozCmgui plugin seems to run in Firefox 2.0 as is. Fixed a crash when a gfx create texture command refers to a memory block that doesn't exist.

      Fixed problems with copies of files getting out of sync. Updated to be compatible with XPCORBA which now uses unix sockets

      when available. Discovered that we have to link omniORB with -Wl,-whole-archive when linking statically otherwise some important static initialisers get left out.

    • Started integrating ITK into CMGUI.

      I have three filters working and I have committed these changes. Now I am trying to get them to build on AIX, IRIX, Darwin and my win32 cross-compile. I have got the AIX version to build with a set of patches to ITK. I should try and build the full tests and examples and send the patches in. Got ITK to build on the windows box and then got an updated cross compile to link and build against that. Darwin has problems as the normal compiler is 3.3 and doesn't seem to allow the template arguments to be specified in template functions. I don't know how to get the 4.0 compiler to work either. I got the IRIX build to work by adding C style MACROS to use in place of the template templates for just this version.

    • Fixed some bugs in the graphics window clip_planes.

    • Improvements to the xul based digitiser.

      Added brightness and contrast controls.

      Newer version at Use it with

    • Implemented spectra for colour maps. Added an option to a material

      "colour_table_spectrum" which evaluates a spectrum and builds a colour lookup table. Created an example and modified mozDigitiser to use it to give brightness and contrast controls. Simplified the spectrums quite a lot internally by presuming that they only operate as DIFFUSE/ALPHA which should make it easier to change them and implement in Material_programs.

    • Saw what I can do in a day with mozCmgui for Phil's hip screw simulator.

    • Improvements to the xul based digitiser.

      Added automatic split groups. Added transparency for the surfaces in the 3D view. Added an extra surface plane in the 3D view. Support for other image orientations.

      Newer version at Use it with

    • Ported the ecg_lab and endoscope animation examples from zinc to mozCmgui.

    • Added a FE_element_field_value cache, so that the

      computed_field_finite_element will keep the FE_element_field_value storage for more than just the last element. This sped up Matt's resampling an order of magnitude. Arbitrarily set the cache maximum size at 1000.

    • Removed the image processing computed fields and the examples to

      test them. I am planning to replace the functionality by integrating ITK.

    • Foolishly got myself messing with the example file generation.

      Added an automatic tar.gz of the source of each example so that it can be easily downloaded.

    • Put many #defines in the emoter so that if can compile without

      Motif where it doesn't have a user interface but still responds to commands.

    • Changed the internal name of element Curves to Curve instead of


    • Released cmgui-2.2.2 and perl_interpreter-2.0.1

      Get to your favourite release centre now.

    • I added some simple mapping backwards to the nodes for the integration

      computed field. This currently only works for line product elements. To do this I did quite a lot of tidying up for the integration computed field. I am adding an example that uses this to renumber the nodes and elements in a mesh using the xi coordinates.

    • Added a new example which generates some isolines and points on those

      isolines from a 2D texture. This example would be helped immensely with some simple image processing.

    • Finally put in support for the non_power_of_two ARB extension for

      textures. This makes memory use and reading time much better for OpenGL implementations which have this extension which is most of them.

    • Changed the default size of textures to zero in dimensions where they are

      only 1 pixel wide. The size defaults to 1 when data is added in the corresponding direction.

    • Added support for lines in 'gfx convert graphics'. Want to add an example

      for creating points on iso_lines.

    • Setting up a /hpc/cmiss cross-compiled build of mozCmgui.

      ( Everything now builds from linux and I have a Makefile which builds all the components. It only checks that cmgui_corba_bridge and mozCmgui are up to date at the moment as I expect the other components to be much more stable. Doing the same process for win32 looks ugly.

    • Volume rendering. I'm trying to improve the volume rendering code in

      cmgui so that we can use colour lookup tables in the graphics card to

      interactively change the rendering of the volumes. I managed to make

      some progress with the curve editor so now I'm up to replacing the spectrum editor.

      Would like to be able to use textures to represent spectrums

      for normal colour spectrums too, so that the data values are interpolated rather than the colours.

      Should add a series of initial spectrums and make a simpler way of making

      rgb and grayscale ramps. The spectrum editor should just interpolate between different materials.

    • Image processing. We are thinking how we can use ITK in cmgui.

    • Planning for virtual surgery. We are putting together some plans for

      virtual surgery model and application development and employing Sally to create an eye model.

      Sally needs a script for converting some surface meshes to volumes and

      we need to fix the broken host mesh derivative updates. Written this script although I think we will adjust the meshes slightly (which has meant refitting them unfortunately).

    • Working on OpenCMISS and FieldML I have been compiling and running Sundance which is one of the candidate software frameworks we are evaluating.

    • Making an Xscreensaver which displays a cmgui graphics window. Needs a

      Motif independent X scene_viewer window. Probably as useful tidy up anyway.

    • Investigating how cmgui could be used with libmesh to support

      possible openCMISS use of this software.

    • Making a new digitiser which uses mozCmgui.

    • Added a parameter to "gfx modify texture evaluate" called "fail_material" which allows the user to specify the material used for pixels that fail the evaluation (typically outside the element range). The default material is "transparent_gray50" to be the same as the previous behaviour.

    • Fixed up ipbase export in "fem export cm" so that it doesn't write

      questions about derivatives for bases thata don't have any.

    • Wrote code so you can offset nodes and elements and generate faces and

      lines for node and element files as you read them in.

    • Fixed up code for evaluating left or right handedness of elements to

      use the centre of the element to determine winding order in voltexes and isosurfaces.

    • Added texture wrap modes, edge_clamp_wrap, border_clamp_wrap and

      mirrored_repeat_wrap from recent versions of OpenGL.

    • Added gcc-3.3.6 to our cross-compile environment so we can make

      libraries that depend on (Although I have to explictly set the CXXFLAGS = -I/hpc/cmiss/cross-compile/i386-glibc23-linux/include/c++/3.3.6 to compile mozilla. (gcc-3.4 and above uses Next time we build a cross-compile need to separate out from all the other libs (as in most distributions).

    • Make example of streamlines from nodes. Did this with tetrahedra

      to sort that out too. Had to do quite a lot of work on the isosurfaces to make them work reasonably for tetrahedra as well. Example is

    • I have done a bunch of work on getting streamlines in tetrahedra.

    • Understanding and developing mozCmgui. I have been able

      to add some methods for computed fields. I am hoping to disable computed variables from the next release of cmgui and so want to remove the dependency in mozCmgui too. I have improved the way dependent libraries are loaded for mozCmgui, by using dlopen and ensuring the soname was correctly set in then we don't have to copy these libraries around any more.

    • Fix get_next_element_id Added a very simple caching mechanism where the value found for previous

      searches from 1 are retained in the FE_region. This cached value is reset if any items are removed or their identifiers changed. Decided not to make it more complicated as I don't want to add any overhead to FE_regions when get_next_identifier isn't being used.

    • I broke grid point evaluation at some point and have been working to fix

      it again. There was no example so I have added a simple one.

    • I was trying to track down a memory leak in the new example

      a/seeded_streamlines, that I made last week and discovered that some of the methods in computed_fields were not being updated correctly. I fixed this and then used some macros to try and ensure that the entire set of methods is always being set.

    • Fixed an access count problem with a get selected node list inquiry

      added my Andrew in mozCmgui. He also added a selection change notification callback.

    • Put changes for "gfx select" and "gfx unselect" for nodes into elements


    • Fixed a streamline bug identified by Steven. The tracking was working

      accurately but did not have enough steps to look good on the screen so I have added a new tolerance which is related to the element length scale.

    • Building and testing. I added valgrind testing to the

      cmgui-debug-memorycheck version of the cmgui tests.

      I have been building up a suppression list for all the errors that seem

      to be sourced from libraries. I have released many things that were not being closed/destroyed but in some cases this doesn't fix the leaks anyway. I have finally got all the examples working again.

    • I have made many improvements for image resampling and added a new example
      a/resample_texture where a volume texture is resampled where it's coordinates are

      embedded in a cubic element. I then did some work profiling this example and sped it up a couple of orders of magnitude, largely by making sure that the out of bounds pixels failed smoothly and by making sure the two different regions had different coordinate fields.

    • With some trepidation I have been writing "gfx export cm" which generates

      a set of ipfiles ipcoor, ipbase, ipnode and ipelem which try to match a field in cmgui. The risk is that I end up trying to sort out all sorts of cm file issues. Could possibly be expanded to make an ippara too.

      I have committed this code although haven't publicised it yet. Seeing how it works out with Sally and a few others. Need to write an example. Added the optional export of an ipmap file which maps first order

      derivatives between versions when they are in the same direction or opposite directions.

    • Added 'gfx convert elements' (and changed the old 'gfx convert' to be 'gfx

      convert graphics') which converts one form of elements to another. The only conversion I have implemented so far is the conversion of any 2D element surfaces to true toplevel 2D bicubic hermite elements. The cross-derivatives are not correct and need to think about how to fix this.

    • Reenabled the automatic monochrome storage of gray images saving memory

      when these are read in. Need to add an example. Fixed the incorrect listing of the increment and stop frame number. This broke many examples which I have now fixed.

    • Adding some more logical operations for less_than, greater_than and

      equal_to in computed_fields. Probably should make these C++.

    • Jack is trying to use 'gfx create snake' and wants to fit more than just

      his coordinate field. Can now fit a list fields. He provided me some files with which to make a cool example.

    • Adding a weight field to "gfx snake". Committed and added an example.

      Sped this up several orders of magnitude by rewriting "gfx select" and "gfx unselect". Still some improvement to be made by working "get_next_element_identifier".

    • Fixed a bug which prevented "gfx write finite_elements" from generating a valid file when a regions contains a mixture of 2D and 3D top level elements.

    • Rebuilt the cross-compiler. Now in /hpc/cmiss/cross-compile so it can be

      used by anyone with this drive mounted there. It has glibc2.3 with gcc 3.4, gtk and the latest openmotif 2.3beta2 which avoids the utf8 bugs.

    • Enabled the cmgui with built-in unemap again. Made a special version,

      cmgui-unemap and (cmgui-unemap-debug) and put cmgui-unemap into the cmissmake builds.

    • Writing my PBRF submission.

    • Fixed a typo preventing 'gfx unselect data' from working.

    • Fixed code for contour bands on iso_surfaces.

    • Fixed code in the allocation of large arrays for textures that uses "long

      ints" for calculating the dimensions. I think the x86_64 compilers use 32bits for int whereas our previous 64bit compilers used 64bits for ints and so didn't have problems, or maybe we just never really loaded any big textures? And some more changes.

    • Gtk2 port of the digitiser scripts. Andrew Cantell did most of this. I

      made a few bug fixes and have grappled with rc styles to override the combobox layout back into a list format (with a scrollbar). See Gtk2 Perl Rc style.

    • Added code so that a failing texture allocation when reading successive

      slices ensures the texture is not created (or if in modify that a black single pixel overwrites the texture).

    • Added code so that node changes propogate through a nodal_lookup computed

      field to a computed_field change (to support updating of the graphs in mozCellML).

    • Fixed a couple of bugs in cmgui with the scene editor and an iso_values list.

    • Isosurface decimation. I have rewritten the obj reader to go directly to GT_voltex instead of creating an intermediate iso surface. I have made a convert operation with converts a scene to surface finite_elements or a node cloud, replacing the old surface_data functionality. I have made an example (a/decimation) that creates some decimated iso surfaces and generates a surface mesh and a node cloud from them. I have committed the code and the example. I have chased some memory leaks. The answers vary for each version more than I would like and I still need to try and reduce this variablility if I can.

    • OSX compilation and uidh. Have got a Motif/X build of cmgui and unemap working and have put this into the automatic compilation. This has revealed that the uid2uidh binary store stuff that we have been relying on for Motif for many years actually makes invalid used of the l64a function. I have removed the use of base64 in the uidh files, replacing them with hex codes for the binary values directly, much better.

    • Building and testing. The x86_64 build of cmgui has been incorporated into the standard process, although some spurious optimisation bugs are showing up. We also have recently acquired our new x86_64 linux build machine and I have shifted the x86_64 cmgui compilation and the i686 cmgui compilation to this machine.

    • MozCellML. Support for the cmgui window embedded in MozCellML required some API work. The windows version required text support in windows, for which I finally made a text object and so you can have multiple fonts for different bits of text.

    • Added support in finite_element.c for defining a new set of times for a field on an existing node and field with times.

    • Open sourcing cmgui. Put version 2.0.1 on sourceforge. Added the perl_interpreter and binary distributions for linux, aix and irix.

    • Image sampling. Added an example to show how to extract values at nodal locations from a volume texture.

    • Graph axes. I have added a new coordinate system which is placed relative to the scene_viewer rather than the model coordinates. Then I added support for per compile rendering code to glyphs and used this to make a glyph which has ticks and values like a graph axis. I have made an example of this