[visad] How can I apply logarithmic scaling to Display.Text position?

G'day,

I am working on enhancing the 3D surface plotting functionality of the
MZmine metabolomic platform:

http://mzmine.sourceforge.net/

I've been asked to provide support for logarithmic scaling of the plot's
intensity (z-) axis.

I've managed to get this working based on the LogTest example

ftp://ftp.unidata.ucar.edu/pub/dmurray/LogTest.java

but there's a wrinkle.  Peaks in the surface plot are labelled with
identified metabolites, see for example this image:

http://mzmine.sourceforge.net/img/3D_full.png

I am struggling to define a FunctionType that will correctly position
the labels when logarithmic scaling is applied.

The code I'm using is at the end of the message.  It positions the
labels correctly when linear scaling is applied but their positions are
unchanged when switching to logarithmic scaling.  This is because I
haven't been able to define the annotationFunction to correctly
reference the logCoordinateSystem.  How can I do so?

I'd be grateful for your help.

Thanks,
Chris.

        // Domain.
        final RealType retentionTimeType = RealType.getRealType("RT",
SI.second);
        final RealType mzType = RealType.getRealType("m/z");
        domainTuple = new RealTupleType(retentionTimeType, mzType);

        // Range.
        final RealType intensityType = RealType.getRealType("Intensity");
        final RealType logType = RealType.getRealType("LogValues",
CommonUnit.promiscuous);
        final RealTupleType logReference = new RealTupleType(logType);
        final LogCoordinateSystem logCoordinateSystem = new
LogCoordinateSystem(logReference, LOG_BASE);
        final RealTupleType intensityRange = new
RealTupleType(intensityType, logCoordinateSystem, null);

        peakHeightType = RealType.getRealType("Height");
        annotationType = TextType.getTextType("Annotation");
        pointTupleType = new RealTupleType(retentionTimeType, mzType,
peakHeightType);
        annotationTupleType = new TupleType(new
MathType[]{peakHeightType, annotationType});

        // Create a function from domain (retention time and m/z) to
intensity.
        intensityFunction = new FunctionType(domainTuple, intensityRange);

        // Create a function from domain (retention time and m/z) to
text annotation.
        annotationFunction = new FunctionType(domainTuple,
annotationTupleType);

        // Create a DataReference connecting data to display.
        dataReference = new DataReferenceImpl("data");

        // Create mapping for X,Y,Z axes and color.
        retentionTimeMap = new ScalarMap(retentionTimeType, Display.XAxis);
        mzMap = new ScalarMap(mzType, Display.YAxis);
        intensityMap = new ScalarMap(intensityType, Display.ZAxis);
        logIntensityMap = new ScalarMap(logType, Display.ZAxis);
        heightMap = new ScalarMap(peakHeightType, Display.ZAxis);
        colorMap = new ScalarMap(intensityType, Display.RGB);
        annotationAlphaMap = new ScalarMap(peakHeightType, Display.Alpha);
        final ScalarMap annotationMap = new ScalarMap(annotationType,
Display.Text);

        // Add maps to display.
        addMap(retentionTimeMap);
        addMap(mzMap);
        addMap(heightMap);
        addMap(colorMap);
        addMap(annotationMap);
        addMap(annotationAlphaMap);*
*




Syngenta Limited, Registered in England No 2710846
Registered Office : Syngenta Limited, European Regional Centre, Priestley Road, 
Surrey Research Park, Guildford, Surrey, GU2 7YH, United Kingdom



This message may contain confidential information. If you are not the designated recipient, please notify the sender immediately, and delete the original and any copies. Any use of the message by you is prohibited.


  • 2011 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: