Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
miscmaths
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
miscmaths
Commits
cd6e986e
Commit
cd6e986e
authored
20 years ago
by
Mark Jenkinson
Browse files
Options
Downloads
Patches
Plain Diff
Added copying of misc header info
parent
254ec932
No related branches found
Branches containing commit
Tags
fsl-3_2beta1
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
volume.cc
+13
-33
13 additions, 33 deletions
volume.cc
volumeinfo.h
+9
-1
9 additions, 1 deletion
volumeinfo.h
volumeseries.cc
+9
-2
9 additions, 2 deletions
volumeseries.cc
with
31 additions
and
36 deletions
volume.cc
+
13
−
33
View file @
cd6e986e
...
...
@@ -93,35 +93,7 @@ namespace MISCMATHS {
preThresholdPositions
=
preThresholdPositions
.
Rows
(
1
,
j
);
}
// void Volume::threshold(const volume<int>& pmask)
// {
// Time_Tracer ts("Volume::threshold");
// int size = getVolumeSize();
// int j = 0;
// preThresholdPositions.ReSize(size);
// int i = 0;
// for(int x = 0; x < pmask.xsize(); x++)
// for(int y = 0; y < pmask.ysize(); y++)
// for(int z = 0; z < pmask.zsize(); z++)
// {
// i++;
// if(pmask(x,y,z))
// {
// j++;
// preThresholdPositions(j) = i;
// (*this)(j) = (*this)(i);
// }
// }
// // Discard rest:
// *this = Rows(1,j);
// preThresholdPositions = preThresholdPositions.Rows(1,j);
// }
void
Volume
::
writeAsFloat
(
const
string
&
fname
)
{
...
...
@@ -131,10 +103,13 @@ namespace MISCMATHS {
const
ColumnVector
&
outputvol
=
*
this
;
FSLIO
*
OP
=
FslOpen
(
fname
.
c_str
(),
"wb"
);
FslCloneHeader
(
OP
,
volinfo
.
miscinfo
);
FslSetDim
(
OP
,
volinfo
.
x
,
volinfo
.
y
,
volinfo
.
z
,
1
);
FslSetVoxDim
(
OP
,
volinfo
.
vx
,
volinfo
.
vy
,
volinfo
.
vz
,
0
);
FslSetDataType
(
OP
,
DT_FLOAT
);
FslSetOriginator
(
OP
,
volinfo
.
originator
);
FslSetIntent
(
OP
,
volinfo
.
intent_code
,
volinfo
.
intent_p1
,
volinfo
.
intent_p2
,
volinfo
.
intent_p3
);
int
sizeVol
=
outputvol
.
Nrows
();
...
...
@@ -154,8 +129,6 @@ namespace MISCMATHS {
FslSetMinMax
(
OP
,
(
short
)
fmin
,
(
short
)
fmax
);
// fwrite(qv,sizeVol*sizeof(float),1,OP->imgfp);
//fwrite(&OP->header,sizeof(OP->header),1,OP->hdrfp);
FslWriteHeader
(
OP
);
FslWriteVolumes
(
OP
,
qv
,
1
);
...
...
@@ -172,10 +145,13 @@ namespace MISCMATHS {
const
ColumnVector
&
outputvol
=
*
this
;
FSLIO
*
OP
=
FslOpen
(
fname
.
c_str
(),
"wb"
);
FslCloneHeader
(
OP
,
volinfo
.
miscinfo
);
FslSetDim
(
OP
,
volinfo
.
x
,
volinfo
.
y
,
volinfo
.
z
,
1
);
FslSetVoxDim
(
OP
,
volinfo
.
vx
,
volinfo
.
vy
,
volinfo
.
vz
,
0
);
FslSetDataType
(
OP
,
DT_SIGNED_SHORT
);
FslSetOriginator
(
OP
,
volinfo
.
originator
);
FslSetIntent
(
OP
,
volinfo
.
intent_code
,
volinfo
.
intent_p1
,
volinfo
.
intent_p2
,
volinfo
.
intent_p3
);
int
sizeVol
=
outputvol
.
Nrows
();
...
...
@@ -218,12 +194,16 @@ namespace MISCMATHS {
FslGetDim
(
IP
,
&
x
,
&
y
,
&
z
,
&
v
);
FslGetVoxDim
(
IP
,
&
vx
,
&
vy
,
&
vz
,
&
tr
);
FslGetOriginator
(
IP
,
volinfo
.
originator
);
FslGetIntent
(
IP
,
&
(
volinfo
.
intent_code
),
&
(
volinfo
.
intent_p1
),
&
(
volinfo
.
intent_p2
),
&
(
volinfo
.
intent_p3
));
doscaling
=
FslGetIntensityScaling
(
IP
,
&
slope
,
&
intercept
);
volinfo
.
x
=
x
;
volinfo
.
y
=
y
;
volinfo
.
z
=
z
;
volinfo
.
v
=
v
;
volinfo
.
vx
=
vx
;
volinfo
.
vy
=
vy
;
volinfo
.
vz
=
vz
;
volinfo
.
tr
=
tr
;
volinfo
.
miscinfo
=
FslInit
();
FslCloneHeader
(
volinfo
.
miscinfo
,
IP
);
size_t
imagesize
=
x
*
y
*
z
;
FslGetDataType
(
IP
,
&
type
);
...
...
This diff is collapsed.
Click to expand it.
volumeinfo.h
+
9
−
1
View file @
cd6e986e
...
...
@@ -6,6 +6,8 @@
/* CCOPYRIGHT */
#include
"fslio/fslio.h"
namespace
MISCMATHS
{
#if !defined(__VolumeInfo_h)
...
...
@@ -25,7 +27,13 @@ struct VolumeInfo
float
vz
;
float
tr
;
short
originator
[
5
];
// Intent codes and parameters
short
intent_code
;
float
intent_p1
;
float
intent_p2
;
float
intent_p3
;
FSLIO
*
miscinfo
;
};
...
...
This diff is collapsed.
Click to expand it.
volumeseries.cc
+
9
−
2
View file @
cd6e986e
...
...
@@ -144,12 +144,16 @@ namespace MISCMATHS {
FslGetDim
(
IP
,
&
x
,
&
y
,
&
z
,
&
v
);
FslGetVoxDim
(
IP
,
&
vx
,
&
vy
,
&
vz
,
&
tr
);
FslGetOriginator
(
IP
,
volinfo
.
originator
);
FslGetIntent
(
IP
,
&
(
volinfo
.
intent_code
),
&
(
volinfo
.
intent_p1
),
&
(
volinfo
.
intent_p2
),
&
(
volinfo
.
intent_p3
));
doscaling
=
FslGetIntensityScaling
(
IP
,
&
slope
,
&
intercept
);
volinfo
.
x
=
x
;
volinfo
.
y
=
y
;
volinfo
.
z
=
z
;
volinfo
.
v
=
v
;
volinfo
.
vx
=
vx
;
volinfo
.
vy
=
vy
;
volinfo
.
vz
=
vz
;
volinfo
.
tr
=
tr
;
volinfo
.
miscinfo
=
FslInit
();
FslCloneHeader
(
volinfo
.
miscinfo
,
IP
);
size_t
imagesize
=
x
*
y
*
z
*
v
;
FslGetDataType
(
IP
,
&
type
);
...
...
@@ -240,10 +244,13 @@ namespace MISCMATHS {
FSLIO
*
OP
=
FslOpen
(
fname
.
c_str
(),
"wb"
);
FslCloneHeader
(
OP
,
volinfo
.
miscinfo
);
FslSetDim
(
OP
,
volinfo
.
x
,
volinfo
.
y
,
volinfo
.
z
,
volinfo
.
v
);
FslSetVoxDim
(
OP
,
volinfo
.
vx
,
volinfo
.
vy
,
volinfo
.
vz
,
volinfo
.
tr
);
FslSetDataType
(
OP
,
DT_FLOAT
);
FslSetOriginator
(
OP
,
volinfo
.
originator
);
FslSetIntent
(
OP
,
volinfo
.
intent_code
,
volinfo
.
intent_p1
,
volinfo
.
intent_p2
,
volinfo
.
intent_p3
);
int
volStart
=
1
;
int
volSize
=
getNumSeries
();
...
...
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