OSDN Git Service

Merge branch 'master' of git.osdn.jp:/gitroot/eos/base
[eos/base.git] / src / Tools / mrcImage / mrcImageFeatureCalc / src / init.c
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <string.h>
4 #include <math.h>
5 #include "../inc/config.h"
6 #include "genUtil.h"
7 #include "eosString.h"
8 #include "File.h"
9 #include "Memory.h"
10
11
12 void
13 init0(mrcImageFeatureCalcInfo* info)
14 {
15     info->fptIn = NULL;    info->flagIn = 0;
16     info->fptRef = NULL;    info->flagRef = 0;
17     info->fptOut = stdout;    info->flagOut = 0;
18     info->fptOutGC = NULL;    info->flagOutGC = 0;
19     info->fptOutLabel = NULL;    info->flagOutLabel = 0;
20     info->fptOutPerimeter = NULL;    info->flagOutPerimeter = 0;
21     info->fptOutChain = NULL;    info->flagOutChain = 0;
22     info->fptOutSurfaceArea = NULL;    info->flagOutSurfaceArea = 0;
23     info->fptOutDensityWeightedArea = NULL;    info->flagOutDensityWeightedArea = 0;
24     info->neighbor = 0;    info->flagneighbor = 0;
25     info->fptInDensity = NULL;    info->flagInDensity = 0;
26     info->fptconfigFile = NULL;    info->flagconfigFile = 0;
27     info->mode = 0;    info->flagmode = 0;
28 }
29
30 void
31 init1(mrcImageFeatureCalcInfo* info)
32 {
33     char s[1024];
34     int i;
35     if(!info->flagIn) {
36         stringGetFromFile(s, "In", stdin, stdout, 0);
37         info->In = stringGetNthWord(s, 1, " ,\t");
38         info->flagIn++;
39     }
40     if(info->flagIn) {
41         info->fptIn = fileOpen(info->In, "r");
42     }
43     
44     if(info->flagRef) {
45         info->fptRef = fileOpen(info->Ref, "r");
46     }
47     
48     if(info->flagOut) {
49         info->fptOut = fileOpen(info->Out, "w");
50     }
51     
52     if(info->flagOutGC) {
53         info->fptOutGC = fileOpen(info->OutGC, "w");
54     }
55     
56     if(info->flagOutLabel) {
57         info->fptOutLabel = fileOpen(info->OutLabel, "w");
58     }
59     
60     if(info->flagOutPerimeter) {
61         info->fptOutPerimeter = fileOpen(info->OutPerimeter, "w");
62     }
63     
64     if(info->flagOutChain) {
65         info->fptOutChain = fileOpen(info->OutChain, "w");
66     }
67     
68     if(info->flagOutSurfaceArea) {
69         info->fptOutSurfaceArea = fileOpen(info->OutSurfaceArea, "w");
70     }
71     
72     if(info->flagOutDensityWeightedArea) {
73         info->fptOutDensityWeightedArea = fileOpen(info->OutDensityWeightedArea, "w");
74     }
75     
76     if(info->flagneighbor) {
77     }
78     
79     if(info->flagInDensity) {
80         info->fptInDensity = fileOpen(info->InDensity, "r");
81     }
82     
83     if(info->flagconfigFile) {
84         info->fptconfigFile = fileOpen(info->configFile, "r");
85     }
86     
87     if(info->flagmode) {
88     }
89     
90 }
91 #ifdef KHOROS
92 #include <stdio.h>
93 #include "bootstrap.h"
94 #include "dataserv.h"
95 #include "datamanip.h"
96 extern void func_usage_additions(void);
97 extern void func_free_args(kexit_status status, kaddr client_data);
98 extern void func_get_args(kform* pane);
99
100 void
101 func_usage_additions(void)
102 {
103 }
104 void
105 func_free_args(kexit_status status, kaddr client_data)
106 {
107 }
108 void
109 func_get_args(kform* pane)
110 {
111 }
112 void
113 khorosInit(int argc, char* argv[])
114 {
115     char* eospath;
116     char  panepath[1024];
117     FILE* fpt;
118     
119     eospath = getenv("EOS_HOME");
120     sprintf(panepath, "%s/src/Tools/mrcImage/mrcImageFeatureCalc/src/mrcImageFeatureCalc.pane", eospath);
121     khoros_initialize(argc, argv, "EOS");
122     fpt = fopen(panepath, "r");    if(NULL!=fpt) {
123         fclose(fpt);
124         kclui_initialize(panepath, KGEN_NONE, "EOS", "mrcImageFeatureCalc",
125                      func_usage_additions,
126                      func_get_args,
127                      func_free_args);
128     }
129 }
130 #endif /* KHOROS */