EMAN2
Public Member Functions | Static Public Member Functions | Public Attributes | Private Attributes
EMAN::FitsIO Class Reference

MRC file = header + data (nx x ny x nz). More...

#include <fitsio.h>

Inheritance diagram for EMAN::FitsIO:
Inheritance graph
[legend]
Collaboration diagram for EMAN::FitsIO:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 FitsIO (const string &filename, IOMode rw_mode=READ_ONLY)
 ~FitsIO ()
int read_ctf (Ctf &ctf, int image_index=0)
 Read CTF data from this image.
void write_ctf (const Ctf &ctf, int image_index=0)
 Write CTF data to this image.

Static Public Member Functions

static bool is_valid (const void *first_block, off_t file_size=0)
static int get_mode_size (int mm)
static int to_em_datatype (int mrcmode)
static int to_mrcmode (int em_datatype, int is_complex)

Public Attributes

 DEFINE_IMAGEIO_FUNC

Private Attributes

string filename
IOMode rw_mode
FILE * fitsfile
bool is_big_endian
bool is_new_file
bool initialized
int dstart
int dtype
int nx
int ny
int nz

Detailed Description

MRC file = header + data (nx x ny x nz).

A MRC image file stores 1D, 2D or 3D image. The image's dimensions and pixel type are defined in the header.

Definition at line 48 of file fitsio.h.


Constructor & Destructor Documentation

FitsIO::FitsIO ( const string &  filename,
IOMode  rw_mode = READ_ONLY 
) [explicit]
FitsIO::~FitsIO ( )

Definition at line 54 of file fitsio.cpp.

References fitsfile.

{
        if (fitsfile) {
                fclose(fitsfile);
                fitsfile = 0;
        }
}

Member Function Documentation

static int EMAN::FitsIO::get_mode_size ( int  mm) [static]
bool FitsIO::is_valid ( const void *  first_block,
off_t  file_size = 0 
) [static]

Definition at line 83 of file fitsio.cpp.

References ENTERFUNC, and EXITFUNC.

Referenced by EMAN::EMUtil::get_image_type().

{
        ENTERFUNC;

        if (!first_block) {
                return false;
        }

        if (strncmp("SIMPLE  ",(const char *)first_block,8)==0) return true;

        EXITFUNC;
        return false;
}
int FitsIO::read_ctf ( Ctf ctf,
int  image_index = 0 
) [virtual]

Read CTF data from this image.

Parameters:
ctfUsed to store the CTF data.
image_indexThe index of the image to read.
Returns:
0 if OK; 1 if error.

Reimplemented from EMAN::ImageIO.

Definition at line 236 of file fitsio.cpp.

References ENTERFUNC, EXITFUNC, and EMAN::ImageIO::init().

{
        ENTERFUNC;
        init();
        EXITFUNC;
        return 0;
}
static int EMAN::FitsIO::to_em_datatype ( int  mrcmode) [static]
static int EMAN::FitsIO::to_mrcmode ( int  em_datatype,
int  is_complex 
) [static]
void FitsIO::write_ctf ( const Ctf ctf,
int  image_index = 0 
) [virtual]

Write CTF data to this image.

Parameters:
ctfCtf instance storing the CTF data.
image_indexThe index of the image to write.
Returns:
0 if OK; 1 if error.

Reimplemented from EMAN::ImageIO.

Definition at line 244 of file fitsio.cpp.

References ENTERFUNC, EXITFUNC, and EMAN::ImageIO::init().


Member Data Documentation

Definition at line 54 of file fitsio.h.

int EMAN::FitsIO::dstart [private]

Definition at line 72 of file fitsio.h.

int EMAN::FitsIO::dtype [private]

Definition at line 73 of file fitsio.h.

string EMAN::FitsIO::filename [private]

Definition at line 65 of file fitsio.h.

FILE* EMAN::FitsIO::fitsfile [private]

Definition at line 67 of file fitsio.h.

Referenced by FitsIO(), and ~FitsIO().

bool EMAN::FitsIO::initialized [private]

Definition at line 71 of file fitsio.h.

Referenced by FitsIO().

Definition at line 69 of file fitsio.h.

Referenced by FitsIO().

bool EMAN::FitsIO::is_new_file [private]

Definition at line 70 of file fitsio.h.

Referenced by FitsIO().

int EMAN::FitsIO::nx [private]

Definition at line 74 of file fitsio.h.

int EMAN::FitsIO::ny [private]

Definition at line 74 of file fitsio.h.

int EMAN::FitsIO::nz [private]

Definition at line 74 of file fitsio.h.

Definition at line 66 of file fitsio.h.


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