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 ) )

