First post on here. So I use csh shells for my research (physics... not a CS person). I am trying to rerun the same scripts, but there are ~10 files that have similar variables that I have to change for each different configuration, so I would like one central file for the variables I change that get used in the various csh files.
Basically what I have been trying to do by scouring the internet but have had no success is to have a document with values:
and then be able to call them in different csh files as if I had just done
, where I could then reference it later as $mass[$1] for 0.645 0.645 0.645.
I have tried to do
, but I keep getting 'invalid variable' when I run the csh script.
After I compile a C program, when I run it from a C shell script, it does not print out the results.
e.g:
myCFile.c: main(){printf("Hey");}
myCshScript: myCFile
This does not output "Hey" to the terminal window. I am not even sure if it is executed or not.
What should I do to see the... (2 Replies)
hi, I have a csh script, which has
setenv X xyz etc
My shell is korn
Is there some way I can "source" this to have the variables in my current korn shell?
thanks (3 Replies)
My shell is csh and it is required.
I have a file like sample.txt
------------------------
a b c
d
e
f
g h i
------------------------
I want set the file to a variable and print it out in the same format.
I have tried something like this, but not succed.
% cat ~/tmp/sample.txt
a b c
d... (8 Replies)
I have a simple script that sets a value and reads the value in csh:
set -x
set a = 10
echo $a
The output of the script does not show the value of a
+ set a = 10
+ echo
any help would be great. (4 Replies)
I am trying to call awk from a csh script using
awk '{print $1, -$2, $3}' $fvmod.vel > $fvmod.xzv
and getting awk: Command not found.
Running
awk '{print $1, -$2, $3}' $fvmod.vel > $fvmod.xzv
on the command line with the actual filenames works (2 Replies)
I have to call two awk scripts where the second one used the output from the first one. Am wondering if it may happen that the second awk might start before the first awk finished creating the file...
if ($nAnomaly == 1) then
awk -v anomaly=$Anom -v zloc="$zmin/$zmax" -v dz=$dz \
... (1 Reply)
my working shell is csh and even though if I try to run my script in plain sh, it behaves the same way. Here's a simple script:
#!/bin/sh
desc='"test my changes"'
cmd="echo \"$desc\""
$cmd
I want $desc to be passed as an argument to another command, but csh apparently doesn't like spaces in... (5 Replies)
Hi All,
I want to check existence of variable, whose name gets decided dynamically.
E.g. value of this variable,is derived as $option_"exclude" , where value of option varies depending upon user input.
I am trying to do it in a following way :
set exclude_var = `echo $option"_exclude"`... (3 Replies)
Hi all,
I have a source config file with variables like so:
eth1_ip=192.168.1.99
eth2_ip=192.168.1.123
eth3_ip=172.16.1.1
I am trying to run a script which loops based on the number of eth interfaces on a machine and therefore modifies the variable it calls in the environment based on the... (5 Replies)
Hi All,
I have file which have looks like below
abc=${def}
def=${efg}
efg= "this is the actual value"
based on "abc" value I have to call "efg" value , Am using below lines but it is not working
#!/bin/bash
source file.txt
echo $abc
Please wrap all code, files, input &... (5 Replies)
Discussion started by: Prashanth.K
5 Replies
LEARN ABOUT DEBIAN
gdcmraw
gdcmraw(1) GDCM gdcmraw(1)NAME
gdcmraw - Extract Data Element Value Field.
SYNOPSIS
gdcmraw [options] file-in file-out
DESCRIPTION
The gdcmraw tool is mostly used for development purpose. It is used to extract a specific binary field from a DICOM DataSet.
PARAMETERS
file-in DICOM input filename
file-out output filename
options
PARAMETERS
-i --input Input filename
-o --output Output filename
-t --tag Specify tag to extract value from.
options
-S --split-frags Split fragments into multiple files.
-p --pattern Specify trailing file pattern (see split-frags).
-P --pixel-data Pixel Data trailing 0.
general options
-h--help
print this help text and exit
-v--version
print version information and exit
-V--verbose
verbose mode (warning+error).
-W--warning
warning mode, print warning information
-E--error
error mode, print error information
-D--debug
debug mode, print debug information
Typical usage
Copy Attribute Value to file
This will extract the value at Tag (0025,101b):
$ gdcmraw -i GE_MR_0025xx1bProtocolDataBlock.dcm -t 25,101b -o pdb.raw
Extract Pixel Data
If you do not specify any tag, the Pixel Data element is the default one. So for instance to grab the Pixel Data from an image:
$ gdcmraw -i test.acr -o test.raw
You can then for example compute the md5sum of this pixel data (very useful):
$ md5sum test.raw
f845c8f283d39a0204c325654493ba53 test.raw
Encapsulated Syntax
When the Pixel Data is encapsulated, multiple fragments can be used to store a single slice image:
$ gdcmdump D_CLUNIE_CT1_J2KR.dcm
...
(7fe0,0010) OB # u/l,1 Pixel Data
(fffe,e000) ?? [] # 0,1 Item
(fffe,e000) ?? ff4fff51 029 0 0 0 0 2 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 2 0 # 65536,1 Item
(fffe,e000) ?? 2c7ee68dee3932d38a907b423ef842166488463037d450959b6a5c7389b # 65536,1 Item
(fffe,e000) ?? 483c 3e8c43f44e18a5c733b 2 aada58fe4 c8176a2d71b7f7cdc30c66a6a # 43308,1 Item
(fffe,e0dd) 0
In order to create a J2K image out of it, we need to extract each fragments and concatenate them:
$ gdcmraw -i D_CLUNIE_CT1_J2KR.dcm -o D_CLUNIE_CT1_J2KR.j2k
This is a valid J2K file, using the Kakadu software package:
$ kdu_expand -i D_CLUNIE_CT1_J2KR.j2k -o D_CLUNIE_CT1_J2KR.tiff -record D_CLUNIE_CT1_J2KR.txt
$ cat D_CLUNIE_CT1_J2KR.txt
Sprofile=PROFILE2
Scap=no
Sextensions=0
Ssize={512,512}
Sorigin={0,0}
Stiles={512,512}
Stile_origin={0,0}
Scomponents=1
Ssigned=yes
Sprecision=16
Ssampling={1,1}
Sdims={512,512}
Cycc=no
Cmct=0
Clayers=1
Cuse_sop=no
Cuse_eph=no
Corder=LRCP
Calign_blk_last={no,no}
Clevels=5
Cads=0
Cdfs=0
Cdecomp=B(-:-:-)
Creversible=yes
Ckernels=W5X3
Catk=0
Cuse_precincts=no
Cblk={64,64}
Cmodes=0
Qguard=1
Qabs_ranges=18,19,19,20,19,19,20,19,19,20,19,19,20,19,19,20
>> New attributes for tile 0:
Extract fragments as single file
Sometimes each fragments is in fact a single slice, so we would not need to concatenate them:
$ gdcmdump 00191113.dcm
...
(7fe0,0010) OB # u/l,1 Pixel Data
(fffe,e000) ?? 00 0 0 06b38 1 01077 2 0376 3 0a7f4 4 0 # 20,1 Item
(fffe,e000) ?? ffd8ffc3 0 b 8 2 0 2 0 1 011 0ffc4 01b 0 1 1 1 1 1 1 1 1 0 0 0 0 # 79970,1 Item
(fffe,e000) ?? ffd8ffc3 0 b 8 2 0 2 0 1 011 0ffc4 01b 0 1 1 1 1 1 1 1 1 0 0 0 0 # 81564,1 Item
(fffe,e000) ?? ffd8ffc3 0 b 8 2 0 2 0 1 011 0ffc4 01b 0 1 1 1 1 1 1 1 1 0 0 0 0 # 81694,1 Item
(fffe,e000) ?? ffd8ffc3 0 b 8 2 0 2 0 1 011 0ffc4 01b 0 1 1 1 1 1 1 1 1 0 0 0 0 # 81511 (81512),1 Item
(fffe,e0dd) 0
Let's try to extract those 4 individual Lossless jpeg individually:
$ gdcmraw --split-frags -i 00191113.dcm -o jpeg --pattern %02d.ljpeg
This will output 4 files:
-rw-r--r-- 1 mathieu mathieu 81512 2008-08-08 22:10 jpeg03.ljpeg
-rw-r--r-- 1 mathieu mathieu 81694 2008-08-08 22:10 jpeg02.ljpeg
-rw-r--r-- 1 mathieu mathieu 81564 2008-08-08 22:10 jpeg01.ljpeg
-rw-r--r-- 1 mathieu mathieu 79970 2008-08-08 22:10 jpeg00.ljpeg
Footnote about JPEG files
It is a common misunderstanding to interchange 'JPEG 8bits lossy' with simply JPEG file. The JPEG specification is much broader than simply
the common lossy 8bits file (as found on internet).
You can have
o JPEG Lossy 8bits
o JPEG Lossy 12bits
o JPEG Lossless 2-16bits
Those are what is defined in ITU-T T.81, ISO/IEC IS 10918-1.
SEE ALSO gdcmdump(1), gdcmraw(1)COPYRIGHT
Copyright (c) 2006-2011 Mathieu Malaterre
Version 2.2.0 Tue Feb 5 2013 gdcmraw(1)