hilbertImage           package:HilbertVis           R Documentation

_P_r_o_d_u_c_e _a _m_a_t_r_i_x _t_h_a_t _v_i_s_u_a_l_i_z_e_s _a _l_o_n_g _d_a_t_a _v_e_c_t_o_r _a_l_o_n_g _a _H_i_l_b_e_r_t _c_u_r_v_e

_D_e_s_c_r_i_p_t_i_o_n:

     Calculate a Hilbert curve visualization of a long data vector and
     return it as a square matrix.

_U_s_a_g_e:

     hilbertImage(data, level = 9, forEBImage = FALSE)

_A_r_g_u_m_e_n_t_s:

    data: A (potentially very long) vector of numerical data. 

   level: The level of the Hilbert curve, determining the size of the
          returned matrix 

forEBImage: If set to TRUE, an Image object (as defined in the EBImage
          package) will be returned.

          NOTE TO MacOS X USERS: Due to a problem with EBImage's GTK+
          bindings you  are advised not to use EBImage and
          HilbertVis/HilbertVisGUI within the same R session as it
          seems to cause crashes. This shall be rectified soon.  [Note
          added 2008-12-18] 

_D_e_t_a_i_l_s:

     See the package vignette for an explanation of this visualization
     technique.

_V_a_l_u_e:

     A matrix of dimension '2^level' x '2^level'. Each matrix element
     corresponds to a bin of consecutive elements of the data vector,
     the bins arranged to follow the Hilbert curve of the given level.
     The value of a  matrix element is the maximum value of the data
     vector elements in the bin.

     If 'forEBIImage=TRUE', a true-color Image object is returned
     instead, where each pixel is colored according to the palette
     constructed by the function 'hilbertDefaultPalette'.

_N_o_t_e:

     For an interactive GUI to explore a Hilbert curve visualisation,
     use the function 'hilbertDisplay' in the 'HilbertVisGUI' package.

_A_u_t_h_o_r(_s):

     Simon Anders, EMBL-EBI, sanders@fs.tum.de

_E_x_a_m_p_l_e_s:

        # Get a vector with example data
        dataVec <- makeRandomTestData( )
        
        # Plot it in conventional (linear) fashion
        plotLongVector( dataVec )
        
        # Note how the peaks look quite uniform

        # Get the Hilbert curve matrix
        hMat <- hilbertImage( dataVec )
        
        # Plot it with the 'image' function and the 'hilbertDefaultPalette'
        image( hMat, col=hilbertDefaultPalette( max(hMat), asArray=FALSE ) )
        
        # Note how you can now see the non-uniformity hidden in the previous plot.
        # Note also the ugly aliasing when you change the size of the plot window.
        # Using EBImage allows to display in each matrix element as one pixel:
        
        # if( require ( EBImage ) )
        #    display( hilbertImage( dataVec, forEBImage=TRUE ) )

