Journal viewer

From University of Washington - Ubicomp Research Page
Revision as of 20:13, 25 October 2006 by Jonathan Lester (talk | contribs)
Jump to navigationJump to search

Overview

The Journal Viewer is a windows program written by (I believe) Brian Clarkson at the MIT Media Lab which provides a nice way of displaying long amounts of data and adding ground truth annotations. Although we're not actively using the program some of the data we're using has our annotations inside the Journal Viewer and some users will need to install it to retrieve these labels.

The journal viewer works by storing data in a binary format it understand and uses an index file (with a .jrl file extension) to tell it where to find the data and what windows to draw on the screen. Opening a .jrl file with the journal viewer causes it to load and display the data described by the .jrl file. One source of problems is that some automatically created .jrl files have hard-coded path's inside them, if you open a journal and presented with a blank window, open the .jrl file in a text editor and change the dir1 = C:\Some\Path line so that it says dir1 = .\. The path is there for two reasons:

  1. So that you can have a .jrl file in one directory and the data in a separate tree. However, in nearly all the cases we're using the files the .jrl files are in the same directory as the data sources (the .dat, .ind, and .var files).
  2. So that when you access a .jrl file from matlab it knows where to access the directory. If you set dir1 = .\ you need to cd into the directory before executing any Matlab journal commands


Required Files

    These files are not available online, please contact Jonathan if you need to get copies of the Journal Viewer. You should have a directory tree similar to the one below. Simply copy the Journal Viewer Files directory to a stable location on your hard drive.
    Journal Viewer Files
    +---DLLS
    +---Journal Matlab
    ¦   +---matlab
    ¦   +---matlab functions
    ¦   +---seldon bin
    +---Journal Viewer
    


Installing the Console Application (optional)

    Journal Viewer uses a separate process called 'console.exe' to send text output to. Although you don't need to install console doing so will prevent you from getting error messages when trying to start the Journal Viewer. To install copy:
    • Journal Viewer Files\Console.exe
    • Journal Viewer Files\Msvcrtd.dll
    • Journal Viewer Files\Mfc42d.dll
    to your C:\ root.


Associating the Journal Viewer with .jrl files (optional)

    To make opening journal files easier you can simply associate the .jrl file extension with the journal viewer executable, Journal Viewer Files\Journal Viewer\JournalViewer.exe.


Setting up Matlab

    For Matlab to access the ground truth annotations inside our Journal Viewer we need to add a few paths and register some .dlls. To do that we're going to use the setupJournalViewerMatlab function (who's source is listed below and should be in Journal Viewer Files\). This function requires that the journal path be a full file path, that is you cannot say '.\JournalStuff' you need to say 'C:\MyProgs\Apps\JournalStuff' in order for it to correctly register the files. <matlab>% setupJournalViewerMatlab( journalPath, remove ) % % journalPath is the _full_ path to the 'Journal Viewer Files' directory % remove if remove==1 then we remove the journal viewer from our path and de-register its .dlls % by default remove==0 if it is not specified % function setupJournalViewerMatlab( journalPath, remove ) % By default we're setting things up not removing the journal viewer from our path: if( ~exist( 'remove', 'var' ) ) remove = 0; end; % Make sure the journal path is a directory path: if( journalPath(end) ~= '\' | journalPath(end) ~= '/' ) journalPath(end+1) = '/'; end; if( ~exist( journalPath, 'dir' ) ) fprintf( 'WARNING: Unable to find Journal Viewer Directory: %s\n', journalPath ); end; if( ~remove )  % Add the directories to our path addpath( [ journalPath 'DLLS' ] ); addpath( [ journalPath 'Journal Matlab\matlab functions'] ); addpath( [ journalPath 'Journal Matlab\matlab' ] );  % Add these libraries to the registry: [s,w] = system( [ '"' journalPath 'DLLS\' 'plregkey" -o SPLib USEDLL "' journalPath 'DLLS\nspa6.dll"'] ); [s,w] = system( [ '"' journalPath 'DLLS\' 'plregkey" -o IPLib USEDLL "' journalPath 'DLLS\ipla6.dll"'] ); else  % Remove the directories from our path rmpath( [ journalPath 'DLLS' ] ); rmpath( [ journalPath 'Journal Matlab\matlab functions'] ); rmpath( [ journalPath 'Journal Matlab\matlab' ] );  % Remove these libraries from the registry: [s,w] = system( [ '"' journalPath 'DLLS\' 'plregkey" -d SPLib USEDLL "' journalPath 'DLLS\nspa6.dll"'] ); [s,w] = system( [ '"' journalPath 'DLLS\' 'plregkey" -d IPLib USEDLL "' journalPath 'DLLS\ipla6.dll"'] ); end </matlab> After you call setupJournalViewerMatlab with the correct path everything should be ready for you to run the associated journal viewer functions. A simple test is to use the Journal function, who's syntax is object = Journal( 'Filename.jrl' );. If this function works than the Journal Viewer should be setup and ready to use.