changeset 567:e8ec7baf3d84

Initial revision
author neelin <neelin>
date Tue, 31 May 1994 07:56:24 +0000
parents 8ed319eeb9e0
children 508d9d8762fb
files conversion/scxtominc/insertblood.c
diffstat 1 files changed, 70 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
new file mode 100644
--- /dev/null
+++ b/conversion/scxtominc/insertblood.c
@@ -0,0 +1,70 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <minc.h>
+
+#define MIbloodroot "blood_analysis"
+
+
+/* ----------------------------- MNI Header -----------------------------------
+@NAME       : CreateBloodStructures
+@INPUT      : mincHandle  -> a handle for an open MINC file.  This file should
+                             be open for writing, but not in redefinition
+			     mode.
+              bloodHandle -> a handle for an open BNC file.  This file should
+                             be open for reading.
+@OUTPUT     : none
+@RETURNS    : void
+@DESCRIPTION: Copies all variable definitions (with attributes) from the BNC
+              file to the MINC file.  The appropriate dimensions are also
+              copied.
+@METHOD     : none.  Just muddled through.
+@GLOBALS    : none
+@CALLS      : micopy_all_var_defs (MINC library)
+              miadd_child (MINC library)
+@CREATED    : May 30, 1994 by MW
+@MODIFIED   : 
+---------------------------------------------------------------------------- */
+void CreateBloodStructures (int mincHandle, int bloodHandle)
+{
+    int mincRoot;
+    int bloodRoot;
+
+    /*
+     * Copy all the variables with their attributes.
+     */
+
+    (void) micopy_all_var_defs (bloodHandle, mincHandle, 0, NULL);
+
+    /*
+     * Make the blood analysis root variable a child of
+     * the MINC root variable.
+     */
+
+    mincRoot = ncvarid (mincHandle, MIrootvariable);
+    bloodRoot = ncvarid (mincHandle, MIbloodroot);
+    (void) miadd_child (mincHandle, mincRoot, bloodRoot);
+}
+
+
+/* ----------------------------- MNI Header -----------------------------------
+@NAME       : FillBloodStructures
+@INPUT      : mincHandle  -> a handle for an open MINC file.  This file should
+                             be open for writing, but not in redefinition
+			     mode.
+              bloodHandle -> a handle for an open BNC file.  This file should
+                             be open for reading.
+@OUTPUT     : none
+@RETURNS    : void
+@DESCRIPTION: Copies all variable values from the BNC file to the MINC file.
+              The variable themselves should already exist in the MINC file
+              (see CreateBloodStructures).
+@METHOD     : none.  Just muddled through.
+@GLOBALS    : none
+@CALLS      : micopy_all_var_values (MINC library)
+@CREATED    : May 30, 1994 by MW
+@MODIFIED   : 
+---------------------------------------------------------------------------- */
+void FillBloodStructures (int mincHandle, int bloodHandle)
+{
+    (void) micopy_all_var_values (bloodHandle, mincHandle, 0, NULL);
+}