EMAN2
Public Member Functions | Private Attributes
EMAN::GatanDM4::TagGroup Class Reference

#include <dm4io.h>

Collaboration diagram for EMAN::GatanDM4::TagGroup:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 TagGroup (FILE *data_file, TagTable *tagtable, const string &groupname)
 ~TagGroup ()
int read_tag_group (bool nodata=false, int image_index=0, int num_images=1)
string get_name () const
int get_entry_id ()

Private Attributes

FILE * in
TagTabletagtable
string name
int entry_id

Detailed Description

Definition at line 145 of file dm4io.h.


Constructor & Destructor Documentation

TagGroup::TagGroup ( FILE *  data_file,
TagTable tagtable,
const string &  groupname 
)

Definition at line 678 of file dm4io.cpp.

        :       in(data_file), tagtable(table), name(groupname), entry_id(0)
{
}
TagGroup::~TagGroup ( )

Definition at line 683 of file dm4io.cpp.

{
}

Member Function Documentation

int TagGroup::get_entry_id ( )

Definition at line 737 of file dm4io.cpp.

References entry_id.

Referenced by EMAN::GatanDM4::TagEntry::read_tag_entry().

{
        int id = entry_id;
        entry_id++;
        return id;
}
string TagGroup::get_name ( ) const

Definition at line 732 of file dm4io.cpp.

References name.

Referenced by EMAN::GatanDM4::TagEntry::read_tag_entry().

{
        return name;
}
int TagGroup::read_tag_group ( bool  nodata = false,
int  image_index = 0,
int  num_images = 1 
)

Definition at line 687 of file dm4io.cpp.

References EMAN::ByteOrder::become_big_endian(), in, LOGVAR, EMAN::GatanDM4::TagEntry::read_tag_entry(), and tagtable.

Referenced by EMAN::DM4IO::get_nimg(), and EMAN::GatanDM4::TagEntry::read_tag_entry().

{
        LOGVAR("TagGroup::read_tag_group()");
        char is_sorted, is_open;

        long long ntags = 0;
        
//      portable_fseek(in, sizeof(char) * 2, SEEK_CUR);
        size_t nr;
        nr = fread(&is_sorted, sizeof(is_sorted), 1, in);
        nr = fread(&is_open,   sizeof(is_open),   1, in);

        nr = fread(&ntags, sizeof(ntags), 1, in);
        
        ByteOrder::become_big_endian(&ntags);

        LOGVAR("DM4: ntags = %d\n", ntags);
        
        int err = 0;
        // char flagend;
        for (int i = 0; i < ntags; i++) {
                /*
                portable_fseek(in, sizeof(char) * 9, SEEK_CUR);
                nr = fread(&flagend, sizeof(char), 1, in);
                
                if (flagend ==EOF){
                        break;
                }
                else{
                        portable_fseek(in, -sizeof(char) * 10, SEEK_CUR);;
                }
                
                */
                
                TagEntry tag_entry(in, tagtable, this);
                err = tag_entry.read_tag_entry(nodata, image_index, num_images);

                if (err) {
                        break;
                }
        }

        return err;
}

Member Data Documentation

Definition at line 159 of file dm4io.h.

Referenced by get_entry_id().

Definition at line 156 of file dm4io.h.

Referenced by read_tag_group().

Definition at line 158 of file dm4io.h.

Referenced by get_name().

Definition at line 157 of file dm4io.h.

Referenced by read_tag_group().


The documentation for this class was generated from the following files: