<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://cni.su.domains/wiki/index.php?action=history&amp;feed=atom&amp;title=NIMS_archive</id>
	<title>NIMS archive - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://cni.su.domains/wiki/index.php?action=history&amp;feed=atom&amp;title=NIMS_archive"/>
	<link rel="alternate" type="text/html" href="http://cni.su.domains/wiki/index.php?title=NIMS_archive&amp;action=history"/>
	<updated>2026-10-30T10:34:10Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>http://cni.su.domains/wiki/index.php?title=NIMS_archive&amp;diff=1841&amp;oldid=prev</id>
		<title>imported&gt;Bobd: Created page with &quot;MR Steward, a key component of NIMS, is already installed at the CNI and is useful for organizing and archiving the data that you collect here.  = MR Steward info = ==Development...&quot;</title>
		<link rel="alternate" type="text/html" href="http://cni.su.domains/wiki/index.php?title=NIMS_archive&amp;diff=1841&amp;oldid=prev"/>
		<updated>2012-01-20T23:06:10Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;MR Steward, a key component of NIMS, is already installed at the CNI and is useful for organizing and archiving the data that you collect here.  = MR Steward info = ==Development...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;MR Steward, a key component of NIMS, is already installed at the CNI and is useful for organizing and archiving the data that you collect here.&lt;br /&gt;
&lt;br /&gt;
= MR Steward info =&lt;br /&gt;
==Development History==&lt;br /&gt;
===Version 0.1 - dicomxfer===&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Features:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*Command-line controlled search and transfer of studies from CNIMR to CNIRT. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Methods:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
I made use of DCMTK package for findscu and movescu, shell commands that&lt;br /&gt;
provide search and transfer functionality of dicom data.  Both commands require&lt;br /&gt;
verbose user input, so I wrapped them Python to allow more concise interaction.&lt;br /&gt;
Information provided by findscu is parsed and used to rename and organize files&lt;br /&gt;
upon download. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Problems:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*Nobody likes command-line tools.&lt;br /&gt;
&lt;br /&gt;
===Version 0.2 - dicomxfer===&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Features:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*GUI controlled search and transfer of studies from CNIMR to CNIRT.&lt;br /&gt;
*Transfer triggers creation of niftis, bvals, and bvecs files.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Methods:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The GUI is implemented with wxPython.  A combination of the pydicom, nibabel,&lt;br /&gt;
and numpy modules was used to create all derivative files.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Problems:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*No progress indicators.&lt;br /&gt;
*GUI hangs while transferring and processing data. &lt;br /&gt;
*Certain obscure dicom types cause the program to freeze (screen-saves).&lt;br /&gt;
&lt;br /&gt;
===Version 0.2a - dicomxfer===&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Features:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*Persistent GUI control (no hangs).&lt;br /&gt;
*Progress indicators for file transfer and processing.&lt;br /&gt;
*Handle previously error-prone dicom types.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Methods:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Restructured code to approximate model/view/controller model.  The resulting&lt;br /&gt;
modularity made it easier to make use of threading module.  Progress is&lt;br /&gt;
communicated between modules/threads using the Publisher available in the&lt;br /&gt;
wxPython libraries.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Problems:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*No way to transfer incrementally during scans.&lt;br /&gt;
*Takes too long to transfer studies (related to above).&lt;br /&gt;
*Processing of large studies eats into swap space. &lt;br /&gt;
&lt;br /&gt;
===Version 0.3 - dirmonitor===&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Features:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*Passive incremental data transfer (get data immediately).&lt;br /&gt;
*Passive sorting into intuitively named folder structure.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Methods:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
A portion of Jerzy Bodurka&amp;#039;s real-time analysis code transfers dicoms from&lt;br /&gt;
CNIMR to CNIRT using rsync.  The directory structure it creates is fairly&lt;br /&gt;
incomprehensible, so we linked the transferred files to a separate directory&lt;br /&gt;
with a more comprehensible naming scheme.  To accomplish this, we periodically&lt;br /&gt;
compute a set of all files present in the original directory.  New sets are&lt;br /&gt;
diffed against previous sets to determine what files have been added (or&lt;br /&gt;
removed), and performs an operation on each novel file.  The current set is&lt;br /&gt;
maintained in a text file for persistence.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Problems:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*File list becomes a memory hog.  Danger of eventually eating swap space.&lt;br /&gt;
*No way to determine when a series is done transferring.&lt;br /&gt;
*No automatic generation of niftis, bvals, or bvecs (related to above).&lt;br /&gt;
&lt;br /&gt;
===Version 0.4 - dirmonitor===&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Features:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*Passive incremental data transfer (get data immediately).&lt;br /&gt;
*Detects separate acquisitions within series.&lt;br /&gt;
*Vastly reduced memory footprint.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Methods:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
We abandoned Jerzy Bodurka&amp;#039;s code.  With the help of Gunnar Schaefer, CNIMR was&lt;br /&gt;
set to export its dicom directory and we read all incoming data directly from&lt;br /&gt;
that.&lt;br /&gt;
&lt;br /&gt;
In addition to configuring the export directory, Gunnar helped devise a new,&lt;br /&gt;
lightweight algorithm for tracking which files have been completed based on the&lt;br /&gt;
observation that files appears in a nested directory structure of the form&lt;br /&gt;
p(number)/e(number)/s(number)/(dicom_files) where number is 1 through n.   The&lt;br /&gt;
deepest folder level, s(number), represents series.  Each incoming series is&lt;br /&gt;
placed into such a folder, each an increment of 1 from the last.&lt;br /&gt;
&lt;br /&gt;
The creation and modification of such folders allows us to track when files&lt;br /&gt;
have finished being written to a series (e.g. when a folder of&lt;br /&gt;
current_series_number + 1 is created, we&amp;#039;re done working on&lt;br /&gt;
current_series_number).  Using this series number also gives us a very&lt;br /&gt;
lightweight means of maintaining persistence between executions and reduces our&lt;br /&gt;
memory footprint (no more keeping track of EVERY file processed, just the last&lt;br /&gt;
series). &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Problems:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*No derivative file creation.&lt;br /&gt;
*Space wasted by storing dicoms raw in folders.&lt;br /&gt;
&lt;br /&gt;
===Version 0.4a - dirmonitor===&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Features:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*Passive creation of derivative files (.png, .nii.gz, .bval, and .bvec). &lt;br /&gt;
*Passive compression of source dicoms into zip files.&lt;br /&gt;
*Logging implemented.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Methods:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Created dicomtools module to pass lists of files read in with pydicom and have&lt;br /&gt;
all derivative file types automatically created.  Threading was used to&lt;br /&gt;
separate out detecting jobs and performing them, with the queue module used for&lt;br /&gt;
inter-thread communication.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Problems:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*Pfiles aren&amp;#039;t part of transfer protocol.&lt;br /&gt;
&lt;br /&gt;
===Version 0.4b - dirmonitor + pfilemonitor===&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Features:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*Passive transfer of pfiles into same folders.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Methods:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Created pfilemonitor module to independently handle transfer of pfiles.&lt;br /&gt;
Created pfparse module to parse pfile headers.  This is accomplished by running&lt;br /&gt;
GE&amp;#039;s print_raw_headers binary and parsing the text output to create a&lt;br /&gt;
PfileHeader object.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Problems:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*Recons still have to be read independently.&lt;br /&gt;
*Physio data isn&amp;#039;t part of transfer protocol.&lt;br /&gt;
*Program hangs when there are gaps in the incrementing series numbers (these exist?!)&lt;br /&gt;
&lt;br /&gt;
===Version 0.5 - mrsteward===&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Features:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*Passive dicom, pfile, and physio data transfer.&lt;br /&gt;
*Passive derivative file type creation and recon running.&lt;br /&gt;
*Improved persistence and flexibility for extensions. &lt;br /&gt;
*Config file for easy set up on different machines.&lt;br /&gt;
*Logging carried over.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Methods:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Redesigned program structure.  Greater adherence to object-oriented principles.&lt;br /&gt;
Unified previously separate modules and imposed shared structure between&lt;br /&gt;
modules.&lt;br /&gt;
&lt;br /&gt;
Physio data directory exported from CNIMR to CNIRT, and physiofinder module&lt;br /&gt;
created to detect what physio files correspond to a given dicom or pfile, as&lt;br /&gt;
well as compress them.&lt;br /&gt;
&lt;br /&gt;
Created sqltools module with new JobQueue class to handle storing program state&lt;br /&gt;
in an easy to access and manage sqlite database.  Data stored here is available&lt;br /&gt;
to external programs/modules, and thus provides a simple place for future&lt;br /&gt;
modules to view the work being done in real-time.  Opens the possibility for&lt;br /&gt;
nice GUI additions to the tool.  Such changes to the way we queue jobs allows&lt;br /&gt;
better parallelization of jobs and tracking of completed tasks.&lt;br /&gt;
&lt;br /&gt;
Makes use of ConfigParser module to simplify configuration for different&lt;br /&gt;
machines.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Problems:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
*Dependency on print_raw_headers for reading pfiles, rather than pure Python.&lt;br /&gt;
&lt;br /&gt;
= NIMS Info =&lt;br /&gt;
&lt;br /&gt;
MORE HERE!&lt;/div&gt;</summary>
		<author><name>imported&gt;Bobd</name></author>
	</entry>
</feed>