EMAN2
Classes | Functions
EMAN::GatanDM4 Namespace Reference

Classes

class  TagTable
class  TagData
class  TagGroup
class  TagEntry
class  DataType

Functions

int to_em_datatype (int gatan_datatype)
const char * to_str (GatanDM4::TagData::Type type)
const char * to_str (GatanDM4::TagEntry::EntryType type)
const char * to_str (GatanDM4::DataType::GatanDataType type)

Function Documentation

int EMAN::GatanDM4::to_em_datatype ( int  gatan_datatype)

Definition at line 1055 of file dm4io.cpp.

References EMAN::EMUtil::EM_CHAR, EMAN::EMUtil::EM_INT, EMAN::EMUtil::EM_SHORT, EMAN::EMUtil::EM_UCHAR, EMAN::EMUtil::EM_UINT, EMAN::EMUtil::EM_UNKNOWN, EMAN::EMUtil::EM_USHORT, EMAN::GatanDM4::DataType::SIGNED_INT16_DATA, EMAN::GatanDM4::DataType::SIGNED_INT32_DATA, EMAN::GatanDM4::DataType::SIGNED_INT8_DATA, t, EMAN::GatanDM4::DataType::UNSIGNED_INT16_DATA, EMAN::GatanDM4::DataType::UNSIGNED_INT32_DATA, and EMAN::GatanDM4::DataType::UNSIGNED_INT8_DATA.

{
        DataType::GatanDataType type = static_cast < DataType::GatanDataType > (gatan_datatype);
        int t = 0;

        switch (type) {
        case GatanDM4::DataType::SIGNED_INT8_DATA:
                t = EMUtil::EM_CHAR;
                break;
        case GatanDM4::DataType::UNSIGNED_INT8_DATA:
                t = EMUtil::EM_UCHAR;
                break;
        case GatanDM4::DataType::SIGNED_INT16_DATA:
                t = EMUtil::EM_SHORT;
                break;
        case GatanDM4::DataType::UNSIGNED_INT16_DATA:
                t = EMUtil::EM_USHORT;
                break;
        case GatanDM4::DataType::SIGNED_INT32_DATA:
                t = EMUtil::EM_INT;
                break;
        case GatanDM4::DataType::UNSIGNED_INT32_DATA:
                t = EMUtil::EM_UINT;
                break;
        default:
                t = EMUtil::EM_UNKNOWN;
        }

        return t;
}
const char * EMAN::GatanDM4::to_str ( GatanDM4::DataType::GatanDataType  type)

Definition at line 1152 of file dm4io.cpp.

References EMAN::GatanDM4::DataType::BINARY_DATA, EMAN::GatanDM4::DataType::COMPLEX16_DATA, EMAN::GatanDM4::DataType::COMPLEX8_DATA, EMAN::GatanDM4::DataType::OBSELETE_DATA, EMAN::GatanDM4::DataType::PACKED_DATA, EMAN::GatanDM4::DataType::POINT2_FLOAT32_0_DATA, EMAN::GatanDM4::DataType::POINT2_SINT16_0_DATA, EMAN::GatanDM4::DataType::POINT2_SINT16_1_DATA, EMAN::GatanDM4::DataType::POINT2_SINT32_0_DATA, EMAN::GatanDM4::DataType::REAL4_DATA, EMAN::GatanDM4::DataType::REAL8_DATA, EMAN::GatanDM4::DataType::RECT_FLOAT32_0_DATA, EMAN::GatanDM4::DataType::RECT_FLOAT32_1_DATA, EMAN::GatanDM4::DataType::RECT_SINT16_1_DATA, EMAN::GatanDM4::DataType::RECT_SINT32_1_DATA, EMAN::GatanDM4::DataType::RGB_DATA, EMAN::GatanDM4::DataType::RGB_FLOAT32_DATA, EMAN::GatanDM4::DataType::RGB_FLOAT64_DATA, EMAN::GatanDM4::DataType::RGB_UINT16_DATA, EMAN::GatanDM4::DataType::RGB_UINT8_0_DATA, EMAN::GatanDM4::DataType::RGB_UINT8_1_DATA, EMAN::GatanDM4::DataType::RGBA_FLOAT32_DATA, EMAN::GatanDM4::DataType::RGBA_FLOAT64_DATA, EMAN::GatanDM4::DataType::RGBA_UINT16_DATA, EMAN::GatanDM4::DataType::RGBA_UINT8_0_DATA, EMAN::GatanDM4::DataType::RGBA_UINT8_1_DATA, EMAN::GatanDM4::DataType::RGBA_UINT8_2_DATA, EMAN::GatanDM4::DataType::RGBA_UINT8_3_DATA, EMAN::GatanDM4::DataType::SIGNED_INT16_DATA, EMAN::GatanDM4::DataType::SIGNED_INT32_DATA, EMAN::GatanDM4::DataType::SIGNED_INT64_DATA, EMAN::GatanDM4::DataType::SIGNED_INT8_DATA, EMAN::GatanDM4::DataType::UNSIGNED_INT16_DATA, EMAN::GatanDM4::DataType::UNSIGNED_INT32_DATA, EMAN::GatanDM4::DataType::UNSIGNED_INT64_DATA, and EMAN::GatanDM4::DataType::UNSIGNED_INT8_DATA.

{
        switch (type) {
        case GatanDM4::DataType::SIGNED_INT16_DATA:
                return "SIGNED_INT16_DATA";
        case GatanDM4::DataType::REAL4_DATA:
                return "REAL4_DATA";
        case GatanDM4::DataType::COMPLEX8_DATA:
                return "COMPLEX8_DATA";
        case GatanDM4::DataType::OBSELETE_DATA:
                return "OBSELETE_DATA";
        case GatanDM4::DataType::PACKED_DATA:
                return "PACKED_DATA";
        case GatanDM4::DataType::UNSIGNED_INT8_DATA:
                return "UNSIGNED_INT8_DATA";
        case GatanDM4::DataType::SIGNED_INT32_DATA:
                return "SIGNED_INT32_DATA";
        case GatanDM4::DataType::RGB_DATA:
                return "RGB_DATA";
        case GatanDM4::DataType::SIGNED_INT8_DATA:
                return "SIGNED_INT8_DATA";
        case GatanDM4::DataType::UNSIGNED_INT16_DATA:
                return "UNSIGNED_INT16_DATA";
        case GatanDM4::DataType::UNSIGNED_INT32_DATA:
                return "UNSIGNED_INT32_DATA";
        case GatanDM4::DataType::REAL8_DATA:
                return "REAL8_DATA";
        case GatanDM4::DataType::COMPLEX16_DATA:
                return "COMPLEX16_DATA";
        case GatanDM4::DataType::BINARY_DATA:
                return "BINARY_DATA";
        case GatanDM4::DataType::RGB_UINT8_0_DATA:
                return "RGB_UINT8_0_DATA";
        case GatanDM4::DataType::RGB_UINT8_1_DATA:
                return "RGB_UINT8_1_DATA";
        case GatanDM4::DataType::RGB_UINT16_DATA:
                return "RGB_UINT16_DATA";
        case GatanDM4::DataType::RGB_FLOAT32_DATA:
                return "RGB_FLOAT32_DATA";
        case GatanDM4::DataType::RGB_FLOAT64_DATA:
                return "RGB_FLOAT64_DATA";
        case GatanDM4::DataType::RGBA_UINT8_0_DATA:
                return "RGBA_UINT8_0_DATA";
        case GatanDM4::DataType::RGBA_UINT8_1_DATA:
                return "RGBA_UINT8_1_DATA";
        case GatanDM4::DataType::RGBA_UINT8_2_DATA:
                return "RGBA_UINT8_2_DATA";
        case GatanDM4::DataType::RGBA_UINT8_3_DATA:
                return "RGBA_UINT8_3_DATA";
        case GatanDM4::DataType::RGBA_UINT16_DATA:
                return "RGBA_UINT16_DATA";
        case GatanDM4::DataType::RGBA_FLOAT32_DATA:
                return "RGBA_FLOAT32_DATA";
        case GatanDM4::DataType::RGBA_FLOAT64_DATA:
                return "RGBA_FLOAT64_DATA";
        case GatanDM4::DataType::POINT2_SINT16_0_DATA:
                return "POINT2_SINT16_0_DATA";
        case GatanDM4::DataType::POINT2_SINT16_1_DATA:
                return "POINT2_SINT16_1_DATA";
        case GatanDM4::DataType::POINT2_SINT32_0_DATA:
                return "POINT2_SINT32_0_DATA";
        case GatanDM4::DataType::POINT2_FLOAT32_0_DATA:
                return "POINT2_FLOAT32_0_DATA";
        case GatanDM4::DataType::RECT_SINT16_1_DATA:
                return "RECT_SINT16_1_DATA";
        case GatanDM4::DataType::RECT_SINT32_1_DATA:
                return "RECT_SINT32_1_DATA";
        case GatanDM4::DataType::RECT_FLOAT32_1_DATA:
                return "RECT_FLOAT32_1_DATA";
        case GatanDM4::DataType::RECT_FLOAT32_0_DATA:
                return "RECT_FLOAT32_0_DATA";
        case GatanDM4::DataType::SIGNED_INT64_DATA:
                return "SIGNED_INT64_DATA";
        case GatanDM4::DataType::UNSIGNED_INT64_DATA:
                return "UNSIGNED_INT64_DATA";
        default:
                break;
        }
        return "Unknown Type";
}
const char * EMAN::GatanDM4::to_str ( GatanDM4::TagEntry::EntryType  type)

Definition at line 1134 of file dm4io.cpp.

{
        const char *str = "unknown";

        switch (type) {
        case TagEntry::GROUP_TAG:
                str = "Group";
                break;
        case TagEntry::DATA_TAG:
                str = "Data";
                break;
        default:
                str = "unknown";
        }
        return str;
}
const char * EMAN::GatanDM4::to_str ( GatanDM4::TagData::Type  type)

Definition at line 1087 of file dm4io.cpp.

Referenced by EMAN::GatanDM4::TagData::read_any(), EMAN::GatanDM4::TagData::read_array_types(), EMAN::GatanDM4::TagData::read_struct_types(), and EMAN::GatanDM4::TagEntry::read_tag_entry().

{
        const char *str = "unknown";

        switch (type) {
        case TagData::SHORT:
                str = "short";
                break;
        case TagData::INT:
                str = "int";
                break;
        case TagData::USHORT:
                str = "unsigned short";
                break;
        case TagData::UINT:
                str = "unsigned int";
                break;
        case TagData::FLOAT:
                str = "float";
                break;
        case TagData::DOUBLE:
                str = "double";
                break;
        case TagData::BOOLEAN:
                str = "boolean";
                break;
        case TagData::CHAR:
                str = "char";
                break;
        case TagData::OCTET:
                str = "octet";
                break;
        case TagData::STRUCT:
                str = "struct";
                break;
        case TagData::STRING:
                str = "string";
                break;
        case TagData::ARRAY:
                str = "array";
                break;
        default:
                str = "unknown";
        }
        return str;
}