AmitkRawData

## AmitkRawData AmitkRawData |

## Synopsis

    #define             AMITK_RAW_DATA_FORMAT               (rd)
    #define             AMITK_RAW_DATA_DIM                  (rd)
    #define             AMITK_RAW_DATA_DIM_X                (rd)
    #define             AMITK_RAW_DATA_DIM_Y                (rd)
    #define             AMITK_RAW_DATA_DIM_Z                (rd)
    #define             AMITK_RAW_DATA_DIM_G                (rd)
    #define             AMITK_RAW_DATA_DIM_T                (rd)
    #define             GINT32_TO_PDP                       (val)
    #define             GUINT32_TO_PDP                      (val)
    #define             GINT32_FROM_PDP                     (val)
    #define             GUINT32_FROM_PDP                    (val)
    enum                AmitkFormat;
    typedef             amitk_format_UBYTE_t;
    typedef             amitk_format_SBYTE_t;
    typedef             amitk_format_USHORT_t;
    typedef             amitk_format_SSHORT_t;
    typedef             amitk_format_UINT_t;
    typedef             amitk_format_SINT_t;
    typedef             amitk_format_FLOAT_t;
    typedef             amitk_format_DOUBLE_t;
    enum                AmitkRawFormat;
                        AmitkRawData;
    #define             amitk_raw_data_includes_voxel       (rd, vox)
    #define             amitk_raw_data_num_voxels           (rd)
    #define             amitk_raw_data_size_data_mem        (rd)
    #define             amitk_raw_data_get_data_mem         (rd)
    #define             amitk_raw_data_get_data_mem0        (rd)
    AmitkRawData*       amitk_raw_data_new                  (void);
    AmitkRawData*       amitk_raw_data_new_with_data        (AmitkFormat format,
                                                             AmitkVoxel dim);
    AmitkRawData*       amitk_raw_data_new_with_data0       (AmitkFormat format,
                                                             AmitkVoxel dim);
    AmitkRawData*       amitk_raw_data_new_2D_with_data0    (AmitkFormat format,
                                                             amide_intpoint_t y_dim,
                                                             amide_intpoint_t x_dim);
    AmitkRawData*       amitk_raw_data_new_3D_with_data0    (AmitkFormat format,
                                                             amide_intpoint_t z_dim,
                                                             amide_intpoint_t y_dim,
                                                             amide_intpoint_t x_dim);
    AmitkRawData*       amitk_raw_data_import_raw_file      (const gchar *file_name,
                                                             FILE *existing_file,
                                                             AmitkRawFormat raw_format,
                                                             AmitkVoxel dim,
                                                             long file_offset ,
                                                             AmitkUpdateFunc update_func,
                                                             gpointer update_data);
    void                amitk_raw_data_write_xml            (AmitkRawData *raw_data,
                                                             const gchar *name,
                                                             FILE *study_file,
                                                             gchar **output_filename,
                                                             guint64 *location,
                                                             guint64 *size);
    AmitkRawData*       amitk_raw_data_read_xml             (gchar *xml_filename,
                                                             FILE *study_file,
                                                             guint64 location,
                                                             guint64 size,
                                                             gchar **perror_buf,
                                                             AmitkUpdateFunc update_func,
                                                             gpointer update_data);
    amide_data_t        amitk_raw_data_get_value            (const AmitkRawData *rd,
                                                             const AmitkVoxel i);
    gpointer            amitk_raw_data_get_pointer          (const AmitkRawData *rd,
                                                             const AmitkVoxel i);
    AmitkFormat         amitk_raw_format_to_format          (AmitkRawFormat raw_format);
    AmitkRawFormat      amitk_format_to_raw_format          (AmitkFormat data_format);
    #define             amitk_raw_format_calc_num_bytes_per_slice(dim, raw_format)
    #define             amitk_raw_format_calc_num_bytes     (dim, raw_format)
    const gchar*        amitk_raw_format_get_name           (const AmitkRawFormat raw_format);

## Description

## Details

### AMITK_RAW_DATA_FORMAT()

    #define AMITK_RAW_DATA_FORMAT(rd)         (AMITK_RAW_DATA(rd)->format)

`rd` : |

### AMITK_RAW_DATA_DIM()

    #define AMITK_RAW_DATA_DIM(rd)            (AMITK_RAW_DATA(rd)->dim)

`rd` : |

### AMITK_RAW_DATA_DIM_X()

    #define AMITK_RAW_DATA_DIM_X(rd)          (AMITK_RAW_DATA(rd)->dim.x)

`rd` : |

### AMITK_RAW_DATA_DIM_Y()

    #define AMITK_RAW_DATA_DIM_Y(rd)          (AMITK_RAW_DATA(rd)->dim.y)

`rd` : |

### AMITK_RAW_DATA_DIM_Z()

    #define AMITK_RAW_DATA_DIM_Z(rd)          (AMITK_RAW_DATA(rd)->dim.z)

`rd` : |

### AMITK_RAW_DATA_DIM_G()

    #define AMITK_RAW_DATA_DIM_G(rd)          (AMITK_RAW_DATA(rd)->dim.g)

`rd` : |

### AMITK_RAW_DATA_DIM_T()

    #define AMITK_RAW_DATA_DIM_T(rd)          (AMITK_RAW_DATA(rd)->dim.t)

`rd` : |

### GINT32_TO_PDP()

    #define             GINT32_TO_PDP(val)

`val` : |

### GUINT32_TO_PDP()

    #define             GUINT32_TO_PDP(val)

`val` : |

### GINT32_FROM_PDP()

    #define GINT32_FROM_PDP(val)    (GINT32_TO_PDP (val))

`val` : |

### GUINT32_FROM_PDP()

    #define GUINT32_FROM_PDP(val)   (GUINT32_TO_PDP (val))

`val` : |

### enum AmitkFormat

    typedef enum {
      AMITK_FORMAT_UBYTE,
      AMITK_FORMAT_SBYTE,
      AMITK_FORMAT_USHORT,
      AMITK_FORMAT_SSHORT,
      AMITK_FORMAT_UINT,
      AMITK_FORMAT_SINT,
      AMITK_FORMAT_FLOAT,
      AMITK_FORMAT_DOUBLE,
      AMITK_FORMAT_NUM
    } AmitkFormat;

### amitk_format_UBYTE_t

    typedef guint8  amitk_format_UBYTE_t;

### amitk_format_SBYTE_t

    typedef gint8   amitk_format_SBYTE_t;

### amitk_format_USHORT_t

    typedef guint16 amitk_format_USHORT_t;

### amitk_format_SSHORT_t

    typedef gint16  amitk_format_SSHORT_t;

### amitk_format_UINT_t

    typedef guint32 amitk_format_UINT_t;

### amitk_format_SINT_t

    typedef gint32  amitk_format_SINT_t;

### amitk_format_FLOAT_t

    typedef gfloat  amitk_format_FLOAT_t;

### amitk_format_DOUBLE_t

    typedef gdouble amitk_format_DOUBLE_t;

### enum AmitkRawFormat

    typedef enum {
      AMITK_RAW_FORMAT_UBYTE_8_NE,
      AMITK_RAW_FORMAT_SBYTE_8_NE,
      AMITK_RAW_FORMAT_USHORT_16_LE,
      AMITK_RAW_FORMAT_SSHORT_16_LE,
      AMITK_RAW_FORMAT_UINT_32_LE,
      AMITK_RAW_FORMAT_SINT_32_LE,
      AMITK_RAW_FORMAT_FLOAT_32_LE,
      AMITK_RAW_FORMAT_DOUBLE_64_LE,
      AMITK_RAW_FORMAT_USHORT_16_BE,
      AMITK_RAW_FORMAT_SSHORT_16_BE,
      AMITK_RAW_FORMAT_UINT_32_BE,
      AMITK_RAW_FORMAT_SINT_32_BE,
      AMITK_RAW_FORMAT_FLOAT_32_BE,
      AMITK_RAW_FORMAT_DOUBLE_64_BE,
      AMITK_RAW_FORMAT_UINT_32_PDP,
      AMITK_RAW_FORMAT_SINT_32_PDP,
      AMITK_RAW_FORMAT_FLOAT_32_PDP,
      AMITK_RAW_FORMAT_ASCII_8_NE,
      AMITK_RAW_FORMAT_NUM
    } AmitkRawFormat;

### AmitkRawData

    typedef struct {
      GObject parent;

      AmitkVoxel dim;
      gpointer data;
      AmitkFormat format;
    } AmitkRawData;

### amitk_raw_data_includes_voxel()

    #define             amitk_raw_data_includes_voxel(rd, vox)

`rd` : |
`vox` : |

### amitk_raw_data_num_voxels()

    #define amitk_raw_data_num_voxels(rd) ((rd)->dim.x * (rd)->dim.y * (rd)->dim.z * (rd)->dim.g * (rd)->dim.t)

`rd` : |

### amitk_raw_data_size_data_mem()

    #define amitk_raw_data_size_data_mem(rd) (amitk_raw_data_num_voxels(rd) * amitk_format_sizes[(rd)->format])

`rd` : |

### amitk_raw_data_get_data_mem()

    #define amitk_raw_data_get_data_mem(rd) (g_try_malloc(amitk_raw_data_size_data_mem(rd)))

`rd` : |

### amitk_raw_data_get_data_mem0()

    #define amitk_raw_data_get_data_mem0(rd) (g_try_malloc0(amitk_raw_data_size_data_mem(rd)))

`rd` : |

### amitk_raw_data_new ()

    AmitkRawData*       amitk_raw_data_new                  (void);

Returns : |

### amitk_raw_data_new_with_data ()

    AmitkRawData*       amitk_raw_data_new_with_data        (AmitkFormat format,
                                                             AmitkVoxel dim);

`format` : |
`dim` : |
Returns : |

### amitk_raw_data_new_with_data0 ()

    AmitkRawData*       amitk_raw_data_new_with_data0       (AmitkFormat format,
                                                             AmitkVoxel dim);

`format` : |
`dim` : |
Returns : |

### amitk_raw_data_new_2D_with_data0 ()

    AmitkRawData*       amitk_raw_data_new_2D_with_data0    (AmitkFormat format,
                                                             amide_intpoint_t y_dim,
                                                             amide_intpoint_t x_dim);

`format` : |
`y_dim` : |
`x_dim` : |
Returns : |

### amitk_raw_data_new_3D_with_data0 ()

    AmitkRawData*       amitk_raw_data_new_3D_with_data0    (AmitkFormat format,
                                                             amide_intpoint_t z_dim,
                                                             amide_intpoint_t y_dim,
                                                             amide_intpoint_t x_dim);

`format` : |
`z_dim` : |
`y_dim` : |
`x_dim` : |
Returns : |

### amitk_raw_data_import_raw_file ()

    AmitkRawData*       amitk_raw_data_import_raw_file      (const gchar *file_name,
                                                             FILE *existing_file,
                                                             AmitkRawFormat raw_format,
                                                             AmitkVoxel dim,
                                                             long file_offset ,
                                                             AmitkUpdateFunc update_func,
                                                             gpointer update_data);

`file_name` : |
`existing_file` : |
`raw_format` : |
`dim` : |
`Param5` : |
`update_func` : |
`update_data` : |
Returns : |

### amitk_raw_data_write_xml ()

    void                amitk_raw_data_write_xml            (AmitkRawData *raw_data,
                                                             const gchar *name,
                                                             FILE *study_file,
                                                             gchar **output_filename,
                                                             guint64 *location,
                                                             guint64 *size);

`raw_data` : |
`name` : |
`study_file` : |
`output_filename` : |
`location` : |
`size` : |

### amitk_raw_data_read_xml ()

    AmitkRawData*       amitk_raw_data_read_xml             (gchar *xml_filename,
                                                             FILE *study_file,
                                                             guint64 location,
                                                             guint64 size,
                                                             gchar **perror_buf,
                                                             AmitkUpdateFunc update_func,
                                                             gpointer update_data);

`xml_filename` : |
`study_file` : |
`location` : |
`size` : |
`perror_buf` : |
`update_func` : |
`update_data` : |
Returns : |

### amitk_raw_data_get_value ()

    amide_data_t        amitk_raw_data_get_value            (const AmitkRawData *rd,
                                                             const AmitkVoxel i);

`rd` : |
`i` : |
Returns : |

### amitk_raw_data_get_pointer ()

    gpointer            amitk_raw_data_get_pointer          (const AmitkRawData *rd,
                                                             const AmitkVoxel i);

`rd` : |
`i` : |
Returns : |

### amitk_raw_format_to_format ()

    AmitkFormat         amitk_raw_format_to_format          (AmitkRawFormat raw_format);

`raw_format` : |
Returns : |

### amitk_format_to_raw_format ()

    AmitkRawFormat      amitk_format_to_raw_format          (AmitkFormat data_format);

`data_format` : |
Returns : |

### amitk_raw_format_calc_num_bytes_per_slice()

    #define amitk_raw_format_calc_num_bytes_per_slice(dim, raw_format) ((dim).x*(dim).y*amitk_raw_format_sizes[raw_format])

`dim` : |
`raw_format` : |

### amitk_raw_format_calc_num_bytes()

    #define amitk_raw_format_calc_num_bytes(dim, raw_format) ((dim).z*(dim).g*(dim).t*amitk_raw_format_calc_num_bytes_per_slice(dim,raw_format))

`dim` : |
`raw_format` : |

### amitk_raw_format_get_name ()

    const gchar*        amitk_raw_format_get_name           (const AmitkRawFormat raw_format);

`raw_format` : |
Returns : |