Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openstructure
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor 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
schwede
openstructure
Commits
bfd2962a
Commit
bfd2962a
authored
10 years ago
by
Andreas Schenk
Browse files
Options
Downloads
Patches
Plain Diff
added read support for mrc files with mode 5 and 6
parent
af30c699
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/io/src/converting_streams.hh
+4
-0
4 additions, 0 deletions
modules/io/src/converting_streams.hh
modules/io/src/img/map_io_mrc_handler.cc
+8
-4
8 additions, 4 deletions
modules/io/src/img/map_io_mrc_handler.cc
with
12 additions
and
4 deletions
modules/io/src/converting_streams.hh
+
4
−
0
View file @
bfd2962a
...
@@ -204,6 +204,10 @@ public:
...
@@ -204,6 +204,10 @@ public:
{
{
return
read_helper
(
value
,
n
);
return
read_helper
(
value
,
n
);
}
}
BinaryIStream
&
read
(
int8_t
*
value
,
std
::
streamsize
n
)
{
return
read_helper
(
value
,
n
);
}
BinaryIStream
&
read
(
int16_t
*
value
,
std
::
streamsize
n
)
BinaryIStream
&
read
(
int16_t
*
value
,
std
::
streamsize
n
)
{
{
return
read_helper
(
value
,
n
);
return
read_helper
(
value
,
n
);
...
...
This diff is collapsed.
Click to expand it.
modules/io/src/img/map_io_mrc_handler.cc
+
8
−
4
View file @
bfd2962a
...
@@ -841,7 +841,7 @@ void import_helper(img::MapHandle& image, std::istream& in,const MRC& formatmrc)
...
@@ -841,7 +841,7 @@ void import_helper(img::MapHandle& image, std::istream& in,const MRC& formatmrc)
}
else
{
}
else
{
throw
IOException
(
"internal error in MRC io: expected ComplexHalfFrequencyImageState"
);
throw
IOException
(
"internal error in MRC io: expected ComplexHalfFrequencyImageState"
);
}
}
}
else
if
(
header
.
mode
>
=
0
&&
header
.
mode
<
=
2
)
{
}
else
if
(
header
.
mode
=
=
0
||
header
.
mode
=
=
2
||
header
.
mode
==
5
||
header
.
mode
==
6
||
header
.
mode
==
7
)
{
img
::
Size
msize
;
img
::
Size
msize
;
msize
[
header
.
mapc
-
1
]
=
header
.
nc
;
msize
[
header
.
mapc
-
1
]
=
header
.
nc
;
msize
[
header
.
mapr
-
1
]
=
header
.
nr
;
msize
[
header
.
mapr
-
1
]
=
header
.
nr
;
...
@@ -861,11 +861,15 @@ void import_helper(img::MapHandle& image, std::istream& in,const MRC& formatmrc)
...
@@ -861,11 +861,15 @@ void import_helper(img::MapHandle& image, std::istream& in,const MRC& formatmrc)
LOG_INFO
(
"resulting image extent: "
<<
image
.
GetExtent
());
LOG_INFO
(
"resulting image extent: "
<<
image
.
GetExtent
());
if
(
img
::
image_state
::
RealSpatialImageState
*
rs
=
dynamic_cast
<
img
::
image_state
::
RealSpatialImageState
*>
(
image
.
ImageStatePtr
().
get
()))
{
if
(
img
::
image_state
::
RealSpatialImageState
*
rs
=
dynamic_cast
<
img
::
image_state
::
RealSpatialImageState
*>
(
image
.
ImageStatePtr
().
get
()))
{
if
(
header
.
mode
==
0
)
{
if
(
header
.
mode
==
0
)
{
detail
::
real_filler
<
uchar
,
CONVERSIONTYPE
>
(
*
rs
,
f
,
header
);
detail
::
real_filler
<
int8_t
,
CONVERSIONTYPE
>
(
*
rs
,
f
,
header
);
}
else
if
(
header
.
mode
==
1
)
{
}
else
if
(
header
.
mode
==
1
||
header
.
mode
==
5
)
{
detail
::
real_filler
<
unsigned
shor
t
,
CONVERSIONTYPE
>
(
*
rs
,
f
,
header
);
detail
::
real_filler
<
int16_
t
,
CONVERSIONTYPE
>
(
*
rs
,
f
,
header
);
}
else
if
(
header
.
mode
==
2
)
{
}
else
if
(
header
.
mode
==
2
)
{
detail
::
real_filler
<
float
,
CONVERSIONTYPE
>
(
*
rs
,
f
,
header
);
detail
::
real_filler
<
float
,
CONVERSIONTYPE
>
(
*
rs
,
f
,
header
);
}
else
if
(
header
.
mode
==
6
)
{
detail
::
real_filler
<
uint16_t
,
CONVERSIONTYPE
>
(
*
rs
,
f
,
header
);
}
else
if
(
header
.
mode
==
7
)
{
detail
::
real_filler
<
int32_t
,
CONVERSIONTYPE
>
(
*
rs
,
f
,
header
);
}
}
}
else
{
}
else
{
throw
IOException
(
"internal error in MRC/CCP4 io: expected RealSpatialImageState"
);
throw
IOException
(
"internal error in MRC/CCP4 io: expected RealSpatialImageState"
);
...
...
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