Journal viewer: Difference between revisions
mNo edit summary |
mNo edit summary |
||
(6 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
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 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 | The journal viewer works by storing data in a binary format it understands 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. | ||
=== Path Problems === | |||
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 <tt>dir1 = C:\Some\Path</tt> line so that it says <tt>dir1 = .\</tt>. The path is there for two reasons: | |||
# 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). | |||
# So that when you access a .jrl file from matlab it knows where to access the directory. If you set <tt>dir1 = .\</tt> you need to cd into the directory before executing any Matlab journal commands | |||
== Installing Journal Viewer == | |||
=== Required Files === | === Required Files === | ||
<ul> | <ul> | ||
Line 32: | Line 38: | ||
=== Associating the Journal Viewer with .jrl files (optional === | === Associating the Journal Viewer with .jrl files (optional) === | ||
<ul> | <ul> | ||
To make opening journal files easier you can simply associate the .jrl file extension with the journal viewer executable, <tt>Journal Viewer Files\Journal Viewer\JournalViewer.exe</tt>. | To make opening journal files easier you can simply associate the .jrl file extension with the journal viewer executable, <tt>Journal Viewer Files\Journal Viewer\JournalViewer.exe</tt>. | ||
</ul> | </ul> | ||
=== Setting up Matlab === | === Setting up Matlab === | ||
<ul> | <ul> | ||
For Matlab to access the ground truth annotations inside our Journal Viewer we need to add a few paths and register some .dlls. | 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 <tt>Journal Viewer Files\</tt>). 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 ) | <matlab>% setupJournalViewerMatlab( journalPath, remove ) | ||
% | % | ||
% journalPath is the path to the 'Journal Viewer Files' directory | % 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 | % 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 | % by default remove==0 if it is not specified | ||
Line 49: | Line 56: | ||
% By default we're setting things up not removing the journal viewer from our path: | % By default we're setting things up not removing the journal viewer from our path: | ||
if( ~exist( 'remove', 'var' ) ) remove = 0; end; | 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( ~exist( journalPath, 'dir' ) ) fprintf( 'WARNING: Unable to find Journal Viewer Directory: %s\n', journalPath ); end; | ||
if( ~remove ) | 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 | 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 | end | ||
</matlab> | </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 <tt>Journal</tt> function, who's syntax is <tt>object = Journal( 'Filename.jrl' );</tt>. If this function works than the Journal Viewer should be setup and ready to use. | |||
</ul> | </ul> | ||
== Annotating Data with Journal Viewer == | |||
Once your data has been converted you can view and annotate your data in the Journal viewer. When you start the Journal Viewer you should be presented with a main window like so and three additional windows (the generic console will also open if you have installed it): | |||
[[image:JournalViewer.png|left|500px|thumb]] | |||
<br style="clear:both;"/> | |||
[[image:JournalViewer_history.png|left]] [[image:JournalViewer_labels.png|left]] [[image:JournalViewer_timePicker.png|left]] | |||
<br style="clear:both;"/> | |||
* Always do, view->Auto Scale when opening a new Journal to have the viewer adjust the scales of the plotted data. | |||
* You can zoom in by highlighting an area and using Selection->Zoom In. | |||
**Note that often when you zoom in the viewer is not smart enough to check for labels which start/end/or span past your zoomed region. This means that when you zoom in you can often lose labels. | |||
* You can add new labels by highlighting an area, using the label view to select a label set, and a label (either from the drop down or by entering your own), and hitting insert. To delete a label you need to select the correct label set/label highlighting slightly past the start/end of the label you wish to delete, and hitting delete | |||
**Labels are case/whitespace sensitive so "walk" and "walk " are considered as different labels. Be careful when using the label view to avoid adding unintended labels. |
Latest revision as of 19:26, 14 August 2008
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 understands 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.
Path Problems
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:
- 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).
- 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
Installing Journal Viewer
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
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.
Annotating Data with Journal Viewer
Once your data has been converted you can view and annotate your data in the Journal viewer. When you start the Journal Viewer you should be presented with a main window like so and three additional windows (the generic console will also open if you have installed it):
- Always do, view->Auto Scale when opening a new Journal to have the viewer adjust the scales of the plotted data.
- You can zoom in by highlighting an area and using Selection->Zoom In.
- Note that often when you zoom in the viewer is not smart enough to check for labels which start/end/or span past your zoomed region. This means that when you zoom in you can often lose labels.
- You can add new labels by highlighting an area, using the label view to select a label set, and a label (either from the drop down or by entering your own), and hitting insert. To delete a label you need to select the correct label set/label highlighting slightly past the start/end of the label you wish to delete, and hitting delete
- Labels are case/whitespace sensitive so "walk" and "walk " are considered as different labels. Be careful when using the label view to avoid adding unintended labels.