Gromacs  2025-dev-20240910-a7e2421
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Enumerations | Functions | Variables
gmx::anonymous_namespace{mrcserializer.cpp} Namespace Reference

Enumerations

enum  MachineStamp : int32_t { MachineStamp::bigEndian = 0x11110000, MachineStamp::smallEndian = 0x44440000 }
 Machine stamp to indicate endianess of mrc/ccp4 file. As named in "EMDB Map Distribution Format Description Version 1.01 (c) emdatabank.org 2014" The first two bytes of a 4 byte unsigned int are used to indicate endianess: 0x11 0x11 big endian 0x44 0x44 small endian Byte-swap data if appropriate, when transferring data files between machines. More...
 

Functions

template<typename ContainerType >
std::enable_if_t
< std::is_same_v< typename
ContainerType::value_type,
int32_t >, void > 
serialize (ISerializer *serializer, ContainerType *valueContainer)
 Serialize a container of int32_t values. Serializes all containers with value_type int32_t that may looped over in a range based for loop and have modifiable elements. More...
 
template<typename ContainerType >
std::enable_if_t
< std::is_same_v< typename
ContainerType::value_type,
float >, void > 
serialize (ISerializer *serializer, ContainerType *valueContainer)
 Serialize a container of float values. Serializes all containers with value_type float that may looped over in a range based for loop and have modifiable elements. More...
 
void serializeIndex (ISerializer *serializer, int32_t *index)
 Serialize and convert from FORTRAN 1-based to C 0-based indices when reading and vice versa when writing.
 
void serializeIndices (ISerializer *serializer, std::array< int32_t, 3 > *valueArray)
 Serializes an integer array and add unity when writing, substracting unity when reading.
 
template<class IntegralType >
std::enable_if_t
<(std::is_integral_v
< IntegralType >
||std::is_enum_v< IntegralType >
), void > 
serializeAsInt32 (ISerializer *serializer, IntegralType *value)
 Serialize input as int32_t via static casting. More...
 
float mrcUnitsToNm (float mrcValue)
 Convert MRC distances to nm.
 
float nmToMrcUnits (float nmValue)
 Convert nm to MRC distances.
 
void serializeDistance (ISerializer *serializer, float *distance)
 Serialize and convert between MRC and GROMACS distance units.
 
void serializeCrystallographicSkewData (ISerializer *serializer, MrcDensitySkewData *skewData)
 Serialize the skew data, words 25-37 in an mrc file.
 
void doMrcDensityMapHeader (ISerializer *serializer, MrcDensityMapHeader *mrcFile)
 Symmetrise and de-serializes the mrc density map header. More...
 

Variables

constexpr float c_nmToMrcUnits = 10
 conversion constant from nm to MRC distance units (Ångström)
 

Enumeration Type Documentation

enum gmx::anonymous_namespace{mrcserializer.cpp}::MachineStamp : int32_t
strong

Machine stamp to indicate endianess of mrc/ccp4 file. As named in "EMDB Map Distribution Format Description Version 1.01 (c) emdatabank.org 2014" The first two bytes of a 4 byte unsigned int are used to indicate endianess: 0x11 0x11 big endian 0x44 0x44 small endian Byte-swap data if appropriate, when transferring data files between machines.

Enumerator
bigEndian 

big endian magic number 0x11 0x11 0x00 0x00 = 286,326,784

smallEndian 

small endian magic number 0x44 0x44 0x00 0x00 = 1,145,307,136

Function Documentation

void gmx::anonymous_namespace{mrcserializer.cpp}::doMrcDensityMapHeader ( ISerializer *  serializer,
MrcDensityMapHeader *  mrcFile 
)

Symmetrise and de-serializes the mrc density map header.

Supports reading EMDB density maps in mrc format according to ftp://ftp.wwpdb.org/pub/emdb/doc/Map-format/current/EMDB_map_format.pdf

Note
format has small differences to http://www.ccpem.ac.uk/mrc_format/mrc2014.php
template<typename ContainerType >
std::enable_if_t<std::is_same_v<typename ContainerType::value_type, int32_t>, void> gmx::anonymous_namespace{mrcserializer.cpp}::serialize ( ISerializer *  serializer,
ContainerType *  valueContainer 
)

Serialize a container of int32_t values. Serializes all containers with value_type int32_t that may looped over in a range based for loop and have modifiable elements.

Template Parameters
ContainerTypetype of container to be serialized
Parameters
[in,out]serializerthe serializer
[in,out]valueContainerthe array to be serialized
template<typename ContainerType >
std::enable_if_t<std::is_same_v<typename ContainerType::value_type, float>, void> gmx::anonymous_namespace{mrcserializer.cpp}::serialize ( ISerializer *  serializer,
ContainerType *  valueContainer 
)

Serialize a container of float values. Serializes all containers with value_type float that may looped over in a range based for loop and have modifiable elements.

Template Parameters
ContainerTypetype of container to be serialized
Parameters
[in,out]serializerthe serializer
[in,out]valueContainerthe array to be serialized
template<class IntegralType >
std::enable_if_t<(std::is_integral_v<IntegralType> || std::is_enum_v<IntegralType>), void> gmx::anonymous_namespace{mrcserializer.cpp}::serializeAsInt32 ( ISerializer *  serializer,
IntegralType *  value 
)

Serialize input as int32_t via static casting.

Template Parameters
IntegralTypetype to be serialized as int32_t