Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
avwutils
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FSL
avwutils
Commits
f6194ab2
Commit
f6194ab2
authored
20 years ago
by
Mark Jenkinson
Browse files
Options
Downloads
Patches
Plain Diff
minor, but useful, touches
parent
2a369247
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
avwcpgeom.c
+23
-9
23 additions, 9 deletions
avwcpgeom.c
fslchfiletype
+5
-3
5 additions, 3 deletions
fslchfiletype
fsledithd
+4
-2
4 additions, 2 deletions
fsledithd
with
32 additions
and
14 deletions
avwcpgeom.c
+
23
−
9
View file @
f6194ab2
...
...
@@ -2,7 +2,7 @@
/* avwcpgeom.c - Copy certain parts of an AVW header
Stephen Smith, FMRIB Image Analysis Group
Mark Jenkinson and
Stephen Smith, FMRIB Image Analysis Group
Copyright (C) 2001 University of Oxford */
...
...
@@ -36,8 +36,10 @@ int main(argc,argv)
{
/* struct dsr hdr, hdr2; */
FSLIO
*
src
=
NULL
,
*
dest
=
NULL
;
short
x
,
y
,
z
,
v
,
copydim
=
1
,
t
;
short
x
,
y
,
z
,
v
,
copydim
=
1
,
t
,
scode
,
qcode
,
dt
=-
1
;
float
vx
,
vy
,
vz
,
tr
;
int
filetype
;
mat44
smat
,
qmat
;
void
*
buffer
=
NULL
;
char
desthdrname
[
10000
];
...
...
@@ -72,9 +74,12 @@ int main(argc,argv)
strcpy
(
desthdrname
,
dest
->
niftiptr
->
fname
);
/* store the filetype and datatype */
filetype
=
FslGetFileType
(
dest
);
FslGetDataType
(
dest
,
&
dt
);
FslClose
(
dest
);
/* ...and now reopen destination for writing */
dest
=
FslOpen
(
desthdrname
,
"wb"
);
dest
=
Fsl
X
Open
(
desthdrname
,
"wb"
,
filetype
);
FslCloneHeader
(
dest
,
src
);
...
...
@@ -93,12 +98,18 @@ int main(argc,argv)
/* hdr2.dime.dim[i]=hdr.dime.dim[i]; */
/* } */
FslGetVoxDim
(
src
,
&
vx
,
&
vy
,
&
vz
,
&
tr
);
FslSetVoxDim
(
dest
,
vx
,
vy
,
vz
,
tr
);
if
(
copydim
)
{
FslGetDim
(
src
,
&
x
,
&
y
,
&
z
,
&
v
);
FslSetDim
(
src
,
x
,
y
,
z
,
v
);
}
scode
=
FslGetStdXform
(
src
,
&
smat
);
FslSetStdXform
(
dest
,
scode
,
smat
);
qcode
=
FslGetRigidXform
(
src
,
&
qmat
);
FslSetRigidXform
(
dest
,
qcode
,
qmat
);
FslGetVoxDim
(
src
,
&
vx
,
&
vy
,
&
vz
,
&
tr
);
FslSetVoxDim
(
dest
,
vx
,
vy
,
vz
,
tr
);
if
(
copydim
)
{
FslGetDim
(
src
,
&
x
,
&
y
,
&
z
,
&
v
);
FslSetDim
(
src
,
x
,
y
,
z
,
v
);
}
/* }}} */
/* {{{ write destination */
...
...
@@ -106,6 +117,9 @@ int main(argc,argv)
/* if ( doswap ) */
/* swap_hdr(&hdr2); */
/* Preserve the datatype */
FslSetDataType
(
dest
,
dt
);
FslWriteHeader
(
dest
);
FslWriteVolumes
(
dest
,
buffer
,
v
);
FslClose
(
dest
);
...
...
This diff is collapsed.
Click to expand it.
fslchfiletype
+
5
−
3
View file @
f6194ab2
...
...
@@ -23,10 +23,10 @@ storedval=$FSLOUTPUTTYPE
FSLOUTPUTTYPE
=
$1
export
FSLOUTPUTTYPE
oldfile
=
$2
oldfile
=
`
$FSLDIR
/bin/remove_ext
$2
`
if
[
$#
-ge
3
]
;
then
newfile
=
$3
newfile
=
`
$FSLDIR
/bin/remove_ext
$3
`
inplace
=
0
else
newfile
=
`
$FSLDIR
/bin/tmpnam
`
...
...
@@ -49,7 +49,9 @@ fi
# for inplace stuff remove and copy old one
if
[
$inplace
=
1
]
;
then
$FSLDIR
/bin/imrm
$oldfile
if
[
`
$FSLDIR
/bin/imtest
$newfile
`
=
1
]
;
then
$FSLDIR
/bin/imrm
$oldfile
fi
$FSLDIR
/bin/immv
$newfile
$oldfile
fi
...
...
This diff is collapsed.
Click to expand it.
fsledithd
+
4
−
2
View file @
f6194ab2
...
...
@@ -23,12 +23,14 @@ if [ _$FSLDIR = _ ] ; then
export
FSLDIR
fi
EDITOR
=
pico
if
[
X
$EDITOR
=
X
]
;
then
EDITOR
=
pico
fi
if
[
$#
-ge
2
]
;
then
EDITOR
=
$2
fi
tmpbase
=
`
${
FSLDIR
}
/bin/tmpnam
`
;
${
FSLDIR
}
/bin/avwhd
-x
$1
>
${
tmpbase
}
${
FSLDIR
}
/bin/avwhd
-x
$1
>
${
tmpbase
}
||
exit
${
EDITOR
}
${
tmpbase
}
${
FSLDIR
}
/bin/avwcreatehd
${
tmpbase
}
$1
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment