A couple of simple tools to create a (somewhat) unique signature of *.dat
files and DICOM files from siemens MRI systems
To install:
go get github.com/hansenms/siemensraw/...
To get a signature from a datfile:
datsignature <DATFILENAME>
To get a signature from a DICOM:
dicomsignature <DICOMFILE>
If signatures from DICOM and *.dat
file match, there is a pretty good chance that the images were generated from the *.dat
file.
The package also provides a tool for extracting any buffer from Siemens *.dat
files:
datbuffer -b Phoenix <DATFILENAME>
Finally there are some tools for creating a filesystem based database for raw data files:
addfile -b <BASEPATH TO BE REMOVED> -d <DESTINATION FOLDER> <DATFILENAME>
To add an entire folder with lots of *.dat
files to the database:
find <FOLDER TO SEARCH> -name "*.dat" -exec addfile -b /mnt/cnmc/ -d <DATABASE PATH> {} \;
To subsequently locate a particular *.dat
file based on signature:
findraw -d <DATABASE PATH> <SIGNATURE>
The output is in json format and you can use a tool like jq
to extract info from the output:
findraw -d <DATABASE PATH> <SIGNATURE> | jq .
cd C:\Go\src\
git clone https://github.com/rajramasawmy/siemensraw.git
cd siemensraw\litwheel
set GOBIN=C:\Go\src\siemensraw\litwheel
set GOPATH=C:\Go\src\siemensraw\litwheel
go install main
rename main.exe litwheel.exe
litwheel -hashlog=<hashlog.txt> -key=<user_ssh_key> -user=<user_name_for_server> -address=<server_ip_address>:<storage_location>
To run for "N" steps (and future, verbose mode):
litwheel -hashlog=<hashlog.txt> -key=<user_ssh_key> -user=<user_name_for_server> -address=<server_ip_address>:<storage_location> -debug=<N>
Example bat script for logging errors and operation
(litwheel -hashlog=<hashlog.txt> -key=<user_ssh_key> -user=<user_name_for_server> -address=<server_ip_address>:<storage_location> || ssh -i <user_ssh_key> <user_name_for_server>@<server_ip_address> "mail -s 'LITwheel FAIL!' person1@mail, person2@mail, person3@mail") | tee logfile.txt
scp -i <user_ssh_key> logfile.txt <user_name_for_server>@<server_ip_address>:<location>
ssh -i <user_ssh_key> <user_name_for_server>@<server_ip_address> "cat <location>/logfile.txt | mail -s 'LITwheel log' person1@mail, person2@mail, person3@mail"
scp -i <user_ssh_key> raidtool.txt <user_name_for_server>@<server_ip_address>:<location>
ssh -i <user_ssh_key> <user_name_for_server>@<server_ip_address> "sh send_raidlog.sh"
send_raidlog.sh Extra fudge script because of some permission errors (using docker)..
docker exec -i <myContainer> bash <<EOF
cd /opt/data/<wherever you sent the raidtool.txt>
chmod 777 raidtool.txt
exit
EOF
cat <docker mount dir>/raidtool.txt | mail -s 'RAID report' person1@mail, person2@mail, person3@mail