## AmitkObject AmitkObject |

## Synopsis

    #define             AMITK_OBJECT_CHILDREN               (object)
    #define             AMITK_OBJECT_PARENT                 (object)
    #define             AMITK_OBJECT_NAME                   (object)
    enum                AmitkObjectType;
    enum                AmitkSelection;
                        AmitkObject;
    AmitkObject*        amitk_object_new                    (void);
    void                amitk_object_write_xml              (AmitkObject *object,
                                                             FILE *study_file,
                                                             gchar **output_filename,
                                                             guint64 *location,
                                                             guint64 *size);
    AmitkObject*        amitk_object_read_xml               (gchar *xml_filename,
                                                             FILE *study_file,
                                                             guint64 location,
                                                             guint64 size,
                                                             gchar **perror_buf);
    AmitkObject*        amitk_object_copy                   (const AmitkObject *object);
    void                amitk_object_copy_in_place          (AmitkObject *dest_object,
                                                             const AmitkObject *src_object);
    void                amitk_object_set_name               (AmitkObject *object,
                                                             const gchar *new_name);
    gboolean            amitk_object_get_selected           (const AmitkObject *object,
                                                             const AmitkSelection which_selection);
    void                amitk_object_set_selected           (AmitkObject *object,
                                                             const gboolean selection,
                                                             const AmitkSelection which_selection);
    #define             amitk_object_select                 (obj, which)
    #define             amitk_object_unselect               (obj, which)
    void                amitk_object_set_parent             (AmitkObject *object,
                                                             AmitkObject *parent);
    void                amitk_object_add_child              (AmitkObject *object,
                                                             AmitkObject *child);
    void                amitk_object_add_children           (AmitkObject *object,
                                                             GList *children);
    gboolean            amitk_object_remove_child           (AmitkObject *object,
                                                             AmitkObject *child);
    gboolean            amitk_object_remove_children        (AmitkObject *object,
                                                             GList *children);
    gboolean            amitk_object_compare_object_type    (AmitkObject *object,
                                                             AmitkObjectType type);
    AmitkObject*        amitk_object_get_parent_of_type     (AmitkObject *object,
                                                             const AmitkObjectType type);
    GList*              amitk_object_get_children_of_type   (AmitkObject *object,
                                                             const AmitkObjectType type,
                                                             const gboolean recurse);
    gboolean            amitk_object_selected_children      (AmitkObject *object,
                                                             const AmitkSelection which_selection,
                                                             gboolean recurse);
    GList*              amitk_object_get_selected_children  (AmitkObject *object,
                                                             const AmitkSelection which_selection,
                                                             const gboolean recurse);
    GList*              amitk_object_get_selected_children_of_type
                                                            (AmitkObject *object,
                                                             const AmitkObjectType type,
                                                             const AmitkSelection which_selection,
                                                             const gboolean recurse);
    gpointer            amitk_object_ref                    (gpointer object);
    gpointer            amitk_object_unref                  (gpointer object);
    GList*              amitk_objects_ref                   (GList *objects);
    GList*              amitk_objects_unref                 (GList *objects);
    gint                amitk_objects_count                 (GList *objects);
    AmitkObject*        amitk_objects_find_object_by_name   (GList *objects,
                                                             const gchar *name);
    gint                amitk_objects_count_pairs_by_name   (GList *objects1,
                                                             GList *objects2);
    GList*              amitk_objects_get_of_type           (GList *objects,
                                                             const AmitkObjectType type,
                                                             const gboolean recurse);
    gboolean            amitk_objects_has_type              (GList *objects,
                                                             const AmitkObjectType type,
                                                             const gboolean recurse);
    void                amitk_objects_write_xml             (GList *objects,
                                                             xmlNodePtr node_list,
                                                             FILE *study_file);
    GList*              amitk_objects_read_xml              (xmlNodePtr node_list,
                                                             FILE *study_file,
                                                             gchar **perror_buf);
    const gchar*        amitk_object_type_get_name          (const AmitkObjectType type);
    const gchar*        amitk_selection_get_name            (const AmitkSelection type);
    extern              gchar * amide_data_file_xml_tag;
    extern              gchar * amide_data_file_xml_start_tag;
    extern              gchar * amide_data_file_xml_end_tag;

## Description

## Details

### AMITK_OBJECT_CHILDREN()

    #define AMITK_OBJECT_CHILDREN(object)   (AMITK_OBJECT(object)->children)

`object` : |

### AMITK_OBJECT_PARENT()

    #define AMITK_OBJECT_PARENT(object)     (AMITK_OBJECT(object)->parent)

`object` : |

### AMITK_OBJECT_NAME()

    #define AMITK_OBJECT_NAME(object)       ((const gchar *) (AMITK_OBJECT(object)->name))

`object` : |

### enum AmitkObjectType

    typedef enum {
      AMITK_OBJECT_TYPE_STUDY,
      AMITK_OBJECT_TYPE_DATA_SET,
      AMITK_OBJECT_TYPE_FIDUCIAL_MARK,
      AMITK_OBJECT_TYPE_ROI,
      AMITK_OBJECT_TYPE_VOLUME,
      AMITK_OBJECT_TYPE_NUM
    } AmitkObjectType;

### enum AmitkSelection

    typedef enum {
      AMITK_SELECTION_SELECTED_0,
      AMITK_SELECTION_SELECTED_1,
      AMITK_SELECTION_SELECTED_2,
      AMITK_SELECTION_NUM,
      AMITK_SELECTION_ANY,
      AMITK_SELECTION_ALL,
    } AmitkSelection;

### AmitkObject

    typedef struct {
      AmitkSpace space;

      gchar * name;

      gboolean selected[AMITK_SELECTION_NUM];
      AmitkObject * parent;
      GList * children;

      GObject * dialog;
    } AmitkObject;

### amitk_object_new ()

    AmitkObject*        amitk_object_new                    (void);

Returns : |

### amitk_object_write_xml ()

    void                amitk_object_write_xml              (AmitkObject *object,
                                                             FILE *study_file,
                                                             gchar **output_filename,
                                                             guint64 *location,
                                                             guint64 *size);

`object` : |
`study_file` : |
`output_filename` : |
`location` : |
`size` : |

### amitk_object_read_xml ()

    AmitkObject*        amitk_object_read_xml               (gchar *xml_filename,
                                                             FILE *study_file,
                                                             guint64 location,
                                                             guint64 size,
                                                             gchar **perror_buf);

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

### amitk_object_copy ()

    AmitkObject*        amitk_object_copy                   (const AmitkObject *object);

`object` : |
Returns : |

### amitk_object_copy_in_place ()

    void                amitk_object_copy_in_place          (AmitkObject *dest_object,
                                                             const AmitkObject *src_object);

`dest_object` : |
`src_object` : |

### amitk_object_set_name ()

    void                amitk_object_set_name               (AmitkObject *object,
                                                             const gchar *new_name);

`object` : |
`new_name` : |

### amitk_object_get_selected ()

    gboolean            amitk_object_get_selected           (const AmitkObject *object,
                                                             const AmitkSelection which_selection);

`object` : |
`which_selection` : |
Returns : |

### amitk_object_set_selected ()

    void                amitk_object_set_selected           (AmitkObject *object,
                                                             const gboolean selection,
                                                             const AmitkSelection which_selection);

`object` : |
`selection` : |
`which_selection` : |

### amitk_object_select()

    #define         amitk_object_select(obj, which)      (amitk_object_set_selected((obj), (TRUE), (which)))

`obj` : |
`which` : |

### amitk_object_unselect()

    #define         amitk_object_unselect(obj, which)    (amitk_object_set_selected((obj), (FALSE), (which)))

`obj` : |
`which` : |

### amitk_object_set_parent ()

    void                amitk_object_set_parent             (AmitkObject *object,
                                                             AmitkObject *parent);

`object` : |
`parent` : |

### amitk_object_add_child ()

    void                amitk_object_add_child              (AmitkObject *object,
                                                             AmitkObject *child);

`object` : |
`child` : |

### amitk_object_add_children ()

    void                amitk_object_add_children           (AmitkObject *object,
                                                             GList *children);

`object` : |
`children` : |

### amitk_object_remove_child ()

    gboolean            amitk_object_remove_child           (AmitkObject *object,
                                                             AmitkObject *child);

`object` : |
`child` : |
Returns : |

### amitk_object_remove_children ()

    gboolean            amitk_object_remove_children        (AmitkObject *object,
                                                             GList *children);

`object` : |
`children` : |
Returns : |

### amitk_object_compare_object_type ()

    gboolean            amitk_object_compare_object_type    (AmitkObject *object,
                                                             AmitkObjectType type);

`object` : |
`type` : |
Returns : |

### amitk_object_get_parent_of_type ()

    AmitkObject*        amitk_object_get_parent_of_type     (AmitkObject *object,
                                                             const AmitkObjectType type);

`object` : |
`type` : |
Returns : |

### amitk_object_get_children_of_type ()

    GList*              amitk_object_get_children_of_type   (AmitkObject *object,
                                                             const AmitkObjectType type,
                                                             const gboolean recurse);

`object` : |
`type` : |
`recurse` : |
Returns : |

### amitk_object_selected_children ()

    gboolean            amitk_object_selected_children      (AmitkObject *object,
                                                             const AmitkSelection which_selection,
                                                             gboolean recurse);

`object` : |
`which_selection` : |
`recurse` : |
Returns : |

### amitk_object_get_selected_children ()

    GList*              amitk_object_get_selected_children  (AmitkObject *object,
                                                             const AmitkSelection which_selection,
                                                             const gboolean recurse);

`object` : |
`which_selection` : |
`recurse` : |
Returns : |

### amitk_object_get_selected_children_of_type ()

    GList*              amitk_object_get_selected_children_of_type
                                                            (AmitkObject *object,
                                                             const AmitkObjectType type,
                                                             const AmitkSelection which_selection,
                                                             const gboolean recurse);

`object` : |
`type` : |
`which_selection` : |
`recurse` : |
Returns : |

### amitk_object_ref ()

    gpointer            amitk_object_ref                    (gpointer object);

`object` : |
Returns : |

### amitk_object_unref ()

    gpointer            amitk_object_unref                  (gpointer object);

`object` : |
Returns : |

### amitk_objects_ref ()

    GList*              amitk_objects_ref                   (GList *objects);

`objects` : |
Returns : |

### amitk_objects_unref ()

    GList*              amitk_objects_unref                 (GList *objects);

`objects` : |
Returns : |

### amitk_objects_count ()

    gint                amitk_objects_count                 (GList *objects);

`objects` : |
Returns : |

### amitk_objects_find_object_by_name ()

    AmitkObject*        amitk_objects_find_object_by_name   (GList *objects,
                                                             const gchar *name);

`objects` : |
`name` : |
Returns : |

### amitk_objects_count_pairs_by_name ()

    gint                amitk_objects_count_pairs_by_name   (GList *objects1,
                                                             GList *objects2);

`objects1` : |
`objects2` : |
Returns : |

### amitk_objects_get_of_type ()

    GList*              amitk_objects_get_of_type           (GList *objects,
                                                             const AmitkObjectType type,
                                                             const gboolean recurse);

`objects` : |
`type` : |
`recurse` : |
Returns : |

### amitk_objects_has_type ()

    gboolean            amitk_objects_has_type              (GList *objects,
                                                             const AmitkObjectType type,
                                                             const gboolean recurse);

`objects` : |
`type` : |
`recurse` : |
Returns : |

### amitk_objects_write_xml ()

    void                amitk_objects_write_xml             (GList *objects,
                                                             xmlNodePtr node_list,
                                                             FILE *study_file);

`objects` : |
`node_list` : |
`study_file` : |

### amitk_objects_read_xml ()

    GList*              amitk_objects_read_xml              (xmlNodePtr node_list,
                                                             FILE *study_file,
                                                             gchar **perror_buf);

`node_list` : |
`study_file` : |
`perror_buf` : |
Returns : |

### amitk_object_type_get_name ()

    const gchar*        amitk_object_type_get_name          (const AmitkObjectType type);

`type` : |
Returns : |

### amitk_selection_get_name ()

    const gchar*        amitk_selection_get_name            (const AmitkSelection type);

`type` : |
Returns : |

### amide_data_file_xml_tag

    extern gchar * amide_data_file_xml_tag;

### amide_data_file_xml_start_tag

    extern gchar * amide_data_file_xml_start_tag;

### amide_data_file_xml_end_tag

    extern gchar * amide_data_file_xml_end_tag;