• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javaandroidc++linuxc#windowsobjective-ccocoaqt誰得pythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisiónc26b43f87fb96c43f559c029b3c95c6fe38fff4f (tree)
Tiempo2015-04-01 15:04:44
AutorTakuo Yasunaga <yasunaga@bio....>
CommiterTakuo Yasunaga

Log Message

ticket: #35034
mrcImageShapePCA

modified output file
LogS

Cambiar Resumen

Diferencia incremental

--- a/src/Objects/DataManip/dmFile/inc/dmFile.h
+++ b/src/Objects/DataManip/dmFile/inc/dmFile.h
@@ -35,11 +35,11 @@ typedef enum dmFileTagDataType {
3535 dmFileTagDataTypeReal8 =7,
3636 dmFileTagDataTypeBool1 =8,
3737 dmFileTagDataTypeChar1 =9,
38- dmFileTagDataTypeInt1 =10,
39- dmFileTagDataTypeInt8 =11,
40- dmFileTagDataTypeStruct =15,
41- dmFileTagDataTypeString =18,
42- dmFileTagDataTypeArray =20
38+ dmFileTagDataTypeInt1 =0xa,
39+ dmFileTagDataTypeInt8 =0xb,
40+ dmFileTagDataTypeStruct =0xf,
41+ dmFileTagDataTypeString =0x12,
42+ dmFileTagDataTypeArray =0x14,
4343 } dmFileTagDataType;
4444
4545 static size_t __dmFileTagDataTypeSize[24] = {
@@ -55,65 +55,69 @@ static char* __dmFileTagDataTypeFormat[24] = {
5555 };
5656
5757 // Header
58-typedef struct dm3FileHeader {
58+typedef struct dmFile3Header {
5959 dmFileInteger4 version;
6060 dmFileInteger4 rootLength;
6161 dmFileInteger4 byteOrder;
62-} dm3FileHeader;
62+} dmFile3Header;
6363
64-typedef struct dm4FileHeader {
64+typedef struct dmFile4Header {
6565 dmFileInteger4 version;
6666 dmFileInteger8 rootLength;
6767 dmFileInteger4 byteOrder;
68-} dm4FileHeader;
68+} dmFile4Header;
6969
70-typedef struct dm3FileRootTagDirectory dm3FileRootTagDirectory;
71-typedef struct dm4FileRootTagDirectory dm4FileRootTagDirectory;
70+typedef struct dmFile3TagDirectory dmFile3TagDirectory;
71+typedef struct dmFile4TagDirectory dmFile4TagDirectory;
7272
73-// Tag Directory
74-typedef struct dm3FileTagDirectrory {
73+// Tag
74+typedef struct dmFile3Tag {
7575 dmFileInteger1 tagID;
7676 dmFileInteger2 tagNameLength; // Bytes
7777 char* tagName;
78+ // Tag
7879 dmFileInteger1 seperator[4];
7980 dmFileInteger4 ninfo;
8081 dmFileInteger4* info;
8182 void* value;
8283 void** value2;
83- dm3FileRootTagDirectory* tagDir;
84-} dm3FileTagDirectrory;
84+ // TagDirectory
85+ dmFile3TagDirectory* tagDir;
86+} dmFile3Tag;
8587
86-typedef struct dm4FileTagDirectrory {
88+typedef struct dmFile4Tag {
8789 dmFileInteger1 tagID;
8890 dmFileInteger2 tagNameLength; // Bytes
8991 char* tagName;
92+ // Tag
9093 dmFileInteger1 seperator[4];
91- dm4FileRootTagDirectory* tagDir;
92-} dm4FileTagDirectrory;
94+ // TagDirectory
95+ dmFile4TagDirectory* tagDir;
96+} dmFile4Tag;
9397
9498 // Root Tag Directory
95-struct dm3FileRootTagDirectory {
99+struct dmFile3TagDirectory {
96100 dmFileInteger1 sortf;
97101 dmFileInteger1 closef;
98102 dmFileInteger4 numberOfTags;
99- dm3FileTagDirectrory* Tags;
103+ dmFile3Tag* Tags;
100104 } ;
101105
102-struct dm4FileRootTagDirectory {
106+struct dmFile4TagDirectory {
103107 dmFileInteger1 sortf;
104108 dmFileInteger1 closef;
105109 dmFileInteger8 numberOfTags;
106- dm4FileTagDirectrory* Tags;
110+ dmFile4Tag* Tags;
107111 } ;
108112
109113 typedef struct dmFile {
110114 // Header
111115 dmFileInteger4 version;
112- dm3FileHeader Header3;
113- dm4FileHeader Header4;
116+ dmFile3Header Header3;
117+ dmFile4Header Header4;
114118 // Root Tag
115- dm3FileRootTagDirectory RootTag3;
116- dm4FileRootTagDirectory RootTag4;
119+ dmFile3TagDirectory RootTag3;
120+ dmFile4TagDirectory RootTag4;
117121 // Tail
118122 dmFileInteger8 Tail;
119123 } dmFile;
@@ -130,16 +134,24 @@ extern "C" {
130134 extern void dmFileInfo(FILE* fpt, dmFile dm, int mode);
131135
132136 // in dmFileRead.c
133-extern void dmFileHeaderTailRead(FILE* fpt, dmFile* dm, char* message, int mode);
134137 extern void dmFileRead(FILE* fpt, dmFile* dm, char* message, int mode);
138+// DM Header and End Read: check file format
139+extern void dmFileHeaderTailRead(FILE* fpt, dmFile* dm, char* message, int mode);
140+// DM3
141+// Header
135142 extern void dmFile3HeaderRead(FILE* fpt, dmFile* dm, char* message, int mode);
136-extern void dmFileTag3RootTagRead(FILE* fpt, dm3FileRootTagDirectory* dmRoot, char* message, int mode);
137-extern void dmFileTag3HeaderRead(FILE* fpt, dm3FileTagDirectrory* dmTag, char* message, int mode);
138-extern void dmFileTag3Read(FILE* fpt, dm3FileTagDirectrory* dmTag, char* message, int mode);
143+//
144+extern void dmFile3TagDirectoryHeaderRead(FILE* fpt, dmFile3TagDirectory* dmRoot, char* message, int mode);
145+extern void dmFile3TagHeaderRead(FILE* fpt, dmFile3Tag* dmTag, char* message, int mode);
146+extern void dmFile3TagRead(FILE* fpt, dmFile3Tag* dmTag, char* message, int mode);
147+
148+// DM4
149+// Header
139150 extern void dmFile4HeaderRead(FILE* fpt, dmFile* dm, char* message, int mode);
140-extern void dmFileTag4RootTagRead(FILE* fpt, dm4FileRootTagDirectory* dmRoot, char* message, int mode);
141-extern void dmFileTag4HeaderRead(FILE* fpt, dm4FileTagDirectrory* dmTag, char* message, int mode);
142-extern void dmFileTag4Read(FILE* fpt, dm4FileTagDirectrory* dmTag, char* message, int mode);
151+//
152+extern void dmFile4TagDirectoryHeaderRead(FILE* fpt, dmFile4TagDirectory* dmRoot, char* message, int mode);
153+extern void dmFile4TagHeaderRead(FILE* fpt, dmFile4Tag* dmTag, char* message, int mode);
154+extern void dmFile4TagRead(FILE* fpt, dmFile4Tag* dmTag, char* message, int mode);
143155
144156 // in dmFileUtil.c
145157 extern void dmFileValuePrint(FILE* fpt, void* value, dmFileTagDataType valueType, int n);
--- a/src/Objects/DataManip/dmFile/src/:
+++ /dev/null
@@ -1,153 +0,0 @@
1-/*
2-# dmFile.h : $Revision$
3-# $Date$
4-# Created by $Author$
5-# Usage : dmFile.h
6-# Attention
7-# $Loccker$
8-# $State$
9-#
10-*/
11-/* $Log$ */
12-#ifndef DMFILE_H
13-#define DMFILE_H
14-
15-#include <stdio.h>
16-
17-/* constant begin */
18-
19-
20-/* constant end */
21-
22-/* struct begin */
23-
24-typedef __int64_t dmFileInteger8;
25-typedef __int32_t dmFileInteger4;
26-typedef __int16_t dmFileInteger2;
27-typedef __int8_t dmFileInteger1;
28-
29-typedef enum dmFileTagDataType {
30- dmFileTagDataTypeInt2 =2,
31- dmFileTagDataTypeInt4 =3,
32- dmFileTagDataTypeUInt2 =4,
33- dmFileTagDataTypeUInt4 =5,
34- dmFileTagDataTypeReal4 =6,
35- dmFileTagDataTypeReal8 =7,
36- dmFileTagDataTypeBool1 =8,
37- dmFileTagDataTypeChar1 =9,
38- dmFileTagDataTypeInt1 =10,
39- dmFileTagDataTypeInt8 =11,
40- dmFileTagDataTypeStruct =15,
41- dmFileTagDataTypeString =18,
42- dmFileTagDataTypeArray =20
43-} dmFileTagDataType;
44-
45-static size_t __dmFileTagDataTypeSize[24] = {
46- 0, 0, 2, 4, 2, 4, 4, 8, 1, 1,
47- 1, 8, 0, 0, 0, 0, 0, 0, 0, 0,
48- 0, 0, 0, 0
49-};
50-
51-static char* __dmFileTagDataTypeFormat[24] = {
52- 0, 0, "%d", "%d", "%u", "%u", "%f", "%f", "%d", "%c",
53- "%d", "%d", 0, 0, 0, 0, 0, 0, 0, 0,
54- 0, 0, 0, 0
55-};
56-
57-// Header
58-typedef struct dm3FileHeader {
59- dmFileInteger4 version;
60- dmFileInteger4 rootLength;
61- dmFileInteger4 byteOrder;
62-} dm3FileHeader;
63-
64-typedef struct dm4FileHeader {
65- dmFileInteger4 version;
66- dmFileInteger8 rootLength;
67- dmFileInteger4 byteOrder;
68-} dm4FileHeader;
69-
70-typedef struct dm3FileRootTagDirectory dm3FileRootTagDirectory;
71-typedef struct dm4FileRootTagDirectory dm4FileRootTagDirectory;
72-
73-// Tag Directory
74-typedef struct dm3FileTagDirectrory {
75- dmFileInteger1 tagID;
76- dmFileInteger2 tagNameLength; // Bytes
77- char* tagName;
78- dmFileInteger1 seperator[4];
79- dmFileInteger4 ninfo;
80- dmFileInteger4* info;
81- void* value;
82- void** value2;
83- dm3FileRootTagDirectory* tagDir;
84-} dm3FileTagDirectrory;
85-
86-typedef struct dm4FileTagDirectrory {
87- dmFileInteger1 tagID;
88- dmFileInteger2 tagNameLength; // Bytes
89- char* tagName;
90- dmFileInteger1 seperator[4];
91- dm4FileRootTagDirectory* tagDir;
92-} dm4FileTagDirectrory;
93-
94-// Root Tag Directory
95-struct dm3FileRootTagDirectory {
96- dmFileInteger1 sortf;
97- dmFileInteger1 closef;
98- dmFileInteger4 numberOfTags;
99- dm3FileTagDirectrory* Tags;
100-} ;
101-
102-struct dm4FileRootTagDirectory {
103- dmFileInteger1 sortf;
104- dmFileInteger1 closef;
105- dmFileInteger8 numberOfTags;
106- dm4FileTagDirectrory* Tags;
107-} dm4FileRootTagDirectory;
108-
109-typedef struct dmFile {
110- // Header
111- dmFileInteger4 version;
112- dm3FileHeader Header3;
113- dm4FileHeader Header4;
114- // Root Tag
115- dm3FileRootTagDirectory RootTag3;
116- dm4FileRootTagDirectory RootTag4;
117- // Tail
118- dmFileInteger8 Tail;
119-} dmFile;
120-
121-/* struct end */
122-
123-#ifdef __cplusplus
124-extern "C" {
125-#endif
126-
127-/* prototype begin */
128-
129-// in dfFileInfo.c
130-extern void dmFileInfo(FILE* fpt, dmFile dm, int mode);
131-
132-// in dmFileRead.c
133-extern void dmFileHeaderTailRead(FILE* fpt, dmFile* dm, char* message, int mode);
134-extern void dmFileRead(FILE* fpt, dmFile* dm, char* message, int mode);
135-extern void dmFile3HeaderRead(FILE* fpt, dmFile* dm, char* message, int mode);
136-extern void dmFileTag3RootTagRead(FILE* fpt, dm3FileRootTagDirectory* dmRoot, char* message, int mode);
137-extern void dmFileTag3HeaderRead(FILE* fpt, dm3FileTagDirectrory* dmTag, char* message, int mode);
138-extern void dmFileTag3Read(FILE* fpt, dm3FileTagDirectrory* dmTag, char* message, int mode);
139-extern void dmFile4HeaderRead(FILE* fpt, dmFile* dm, char* message, int mode);
140-extern void dmFileTag4RootTagRead(FILE* fpt, dm4FileRootTagDirectory* dmRoot, char* message, int mode);
141-extern void dmFileTag4HeaderRead(FILE* fpt, dm4FileTagDirectrory* dmTag, char* message, int mode);
142-extern void dmFileTag4Read(FILE* fpt, dm4FileTagDirectrory* dmTag, char* message, int mode);
143-
144-// in dmFileUtil.c
145-extern void dmFileValuePrint(FILE* fpt, void* value, dmFileTagDataType valueType, int n);
146-
147-/* prototype end */
148-
149-#ifdef __cplusplus
150-};
151-#endif
152-
153-#endif /* DMFILE_H */
--- a/src/Objects/DataManip/dmFile/src/dmFileRead.c
+++ b/src/Objects/DataManip/dmFile/src/dmFileRead.c
@@ -19,6 +19,7 @@ void
1919 dmFileRead(FILE* fpt, dmFile* dm, char* message, int mode)
2020 {
2121 int i, j;
22+ dmFile3Tag* dmTag;
2223
2324 dmFileHeaderTailRead(fpt, dm, message, mode);
2425
@@ -27,36 +28,36 @@ dmFileRead(FILE* fpt, dmFile* dm, char* message, int mode)
2728 // Header
2829 dmFile3HeaderRead(fpt, dm, message, mode);
2930 // Root Tag
30- dmFileTag3RootTagRead(fpt, &(dm->RootTag3), message, mode);
31+ dmFile3TagDirectoryHeaderRead(fpt, &(dm->RootTag3), message, mode);
3132 for(i=0; i<dm->RootTag3.numberOfTags; i++) {
32- DEBUGPRINT1("Tags-i: %d\n", i);
33- dmFileTag3HeaderRead(fpt, &(dm->RootTag3.Tags[i]), message, mode);
33+ dmTag = &(dm->RootTag3.Tags[i]);
34+ DEBUGPRINT2("Tags-i: %d/%d\n", i, dm->RootTag3.numberOfTags);
35+ dmFile3TagHeaderRead(fpt, &(dm->RootTag3.Tags[i]), message, mode);
3436 switch(dm->RootTag3.Tags[i].tagID) {
35- case 0x12: {
36-
37- break;
38- }
3937 case 0x15: { // tag
40- dmFileTag3Read(fpt, &(dm->RootTag3.Tags[i]), message, mode);
38+ DEBUGPRINT("TAG\n");
39+ dmFile3TagRead(fpt, &(dm->RootTag3.Tags[i]), message, mode);
4140 break;
4241 }
4342 case 0x14: { // tag directories
4443 DEBUGPRINT("TAG DIRECTORIES\n");
45- dm->RootTag3.Tags[i].tagDir = memoryAllocate(sizeof(dm3FileRootTagDirectory), message);
46- dmFileTag3RootTagRead(fpt, dm->RootTag3.Tags[i].tagDir, message, mode);
44+ dm->RootTag3.Tags[i].tagDir = memoryAllocate(sizeof(dmFile3TagDirectory), message);
45+ dmFile3TagDirectoryHeaderRead(fpt, dm->RootTag3.Tags[i].tagDir, message, mode);
4746 DEBUGPRINT1("Number of Tages: %d\n", dm->RootTag3.Tags[i].tagDir->numberOfTags);
4847 for(j=0; j<dm->RootTag3.Tags[i].tagDir->numberOfTags; j++) {
4948 DEBUGPRINT1("Tags-j(in tag directories): %d\n", j);
50- dmFileTag3Read(fpt, &(dm->RootTag3.Tags[i].tagDir->Tags[j]), message, mode);
49+ dmFile3TagHeaderRead(fpt, &(dm->RootTag3.Tags[i].tagDir->Tags[j]), message, mode);
50+ dmFile3TagRead(fpt, &(dm->RootTag3.Tags[i].tagDir->Tags[j]), message, mode);
5151 }
5252 break;
5353 }
54- case 0x0: {
54+ case 0x0: {
5555 DEBUGPRINT("FILE END\n")
5656 return;
5757 break;
5858 }
5959 default: {
60+ dmFile3TagRead(fpt, &(dm->RootTag3.Tags[i]), message, mode);
6061 fprintf(stderr, "Not supported tagID: %X\n", dm->RootTag3.Tags[i].tagID);
6162 //exit(EXIT_FAILURE);
6263 break;
@@ -69,7 +70,7 @@ dmFileRead(FILE* fpt, dmFile* dm, char* message, int mode)
6970 // Header
7071 dmFile4HeaderRead(fpt, dm, message, mode);
7172 // Root Tag
72- dmFileTag4RootTagRead(fpt, &(dm->RootTag4), message, mode);
73+ dmFile4TagDirectoryHeaderRead(fpt, &(dm->RootTag4), message, mode);
7374 break;
7475 }
7576 default: {
@@ -83,6 +84,7 @@ dmFileRead(FILE* fpt, dmFile* dm, char* message, int mode)
8384 void
8485 dmFileHeaderTailRead(FILE* fpt, dmFile* dm, char* message, int mode)
8586 {
87+ DEBUGPRINT("dmFileHeaderTailRead\n");
8688 fseek(fpt, 0L, SEEK_SET);
8789 fread(&(dm->version), sizeof(dmFileInteger4), 1, fpt);
8890 #ifdef II
@@ -101,9 +103,10 @@ dmFileHeaderTailRead(FILE* fpt, dmFile* dm, char* message, int mode)
101103 void
102104 dmFile3HeaderRead(FILE* fpt, dmFile* dm, char* message, int mode)
103105 {
106+ DEBUGPRINT("dmFile3HeaderRead\n");
104107 // Header
105108 fseek(fpt, 0L, SEEK_SET);
106- if(12!=sizeof(dm->Header4)) {
109+ if(12!=sizeof(dm->Header3)) {
107110 fprintf(stderr, "Size is strange: %lu expected 12\n", sizeof(dm->Header4));
108111 fread(&(dm->Header3.version), sizeof(dm->Header3.version), 1, fpt);
109112 fread(&(dm->Header3.rootLength), sizeof(dm->Header3.rootLength), 1, fpt);
@@ -148,8 +151,9 @@ dmFile4HeaderRead(FILE* fpt, dmFile* dm, char* message, int mode)
148151 }
149152
150153 void
151-dmFileTag3RootTagRead(FILE* fpt, dm3FileRootTagDirectory* RootTag3, char* message, int mode)
154+dmFile3TagDirectoryHeaderRead(FILE* fpt, dmFile3TagDirectory* RootTag3, char* message, int mode)
152155 {
156+ DEBUGPRINT("dmFileTag3RootTagRead\n");
153157 // Root Tag
154158 fread(&(RootTag3->sortf), sizeof(dmFileInteger1), 1, fpt);
155159 fread(&(RootTag3->closef), sizeof(dmFileInteger1), 1, fpt);
@@ -160,12 +164,13 @@ dmFileTag3RootTagRead(FILE* fpt, dm3FileRootTagDirectory* RootTag3, char* messag
160164 DEBUGPRINT1("sortf: %d\n", RootTag3->sortf);
161165 DEBUGPRINT1("closef: %d\n", RootTag3->closef);
162166 DEBUGPRINT1("numberOfTags: %d\n", RootTag3->numberOfTags);
163- RootTag3->Tags = (dm3FileTagDirectrory*)memoryAllocate(sizeof(dm3FileTagDirectrory)*RootTag3->numberOfTags, "in dmFileRead");
167+ RootTag3->Tags = (dmFile3Tag*)memoryAllocate(sizeof(dmFile3Tag)*RootTag3->numberOfTags, "in dmFileRead");
164168 }
165169
166170 void
167-dmFileTag4RootTagRead(FILE* fpt, dm4FileRootTagDirectory* RootTag4, char* message, int mode)
171+dmFile4TagDirectoryHeaderRead(FILE* fpt, dmFile4TagDirectory* RootTag4, char* message, int mode)
168172 {
173+ DBUGPRINT("dmFile4TagDirectoryHeaderRead");
169174 // Root Tag
170175 fread(&(RootTag4->sortf), sizeof(dmFileInteger1), 1, fpt);
171176 fread(&(RootTag4->closef), sizeof(dmFileInteger1), 1, fpt);
@@ -176,12 +181,13 @@ dmFileTag4RootTagRead(FILE* fpt, dm4FileRootTagDirectory* RootTag4, char* messag
176181 DEBUGPRINT1("sortf: %d\n", RootTag4->sortf);
177182 DEBUGPRINT1("closef: %d\n", RootTag4->closef);
178183 DEBUGPRINT1("numberOfTags: %lld\n", RootTag4->numberOfTags);
179- RootTag4->Tags = (dm4FileTagDirectrory*)memoryAllocate(sizeof(dm4FileTagDirectrory)*RootTag4->numberOfTags, "in dmFileRead");
184+ RootTag4->Tags = (dmFile4Tag*)memoryAllocate(sizeof(dmFile4Tag)*RootTag4->numberOfTags, "in dmFileRead");
180185 }
181186
182187 void
183-dmFileTag3HeaderRead(FILE* fpt, dm3FileTagDirectrory* dmTag, char* message, int mode)
188+dmFile3TagHeaderRead(FILE* fpt, dmFile3Tag* dmTag, char* message, int mode)
184189 {
190+ DEBUGPRINT("dmFileTag3HeaderRead\n");
185191 fread(&(dmTag->tagID), sizeof(dmFileInteger1), 1, fpt);
186192 fread(&(dmTag->tagNameLength), sizeof(dmFileInteger2), 1, fpt);
187193 #ifdef II
@@ -191,26 +197,34 @@ dmFileTag3HeaderRead(FILE* fpt, dm3FileTagDirectrory* dmTag, char* message, int
191197 dmTag->tagName = (char*)memoryAllocate(sizeof(char)*(dmTag->tagNameLength+1), "in dmFileRead");
192198 fread(dmTag->tagName, sizeof(char), dmTag->tagNameLength, fpt);
193199 }
194- DEBUGPRINT3("tag %X %d %s\n", dmTag->tagID, dmTag->tagNameLength, dmTag->tagName);
200+ DEBUGPRINT3("tagID(hex) %X tagNameLength %d tagName %s\n", dmTag->tagID, dmTag->tagNameLength, dmTag->tagName);
195201 }
196202
197203 void
198-dmFileTag3Read(FILE* fpt, dm3FileTagDirectrory* dmTag, char* message, int mode)
204+dmFile3TagRead(FILE* fpt, dmFile3Tag* dmTag, char* message, int mode)
199205 {
200206 int j;
201- DEBUGPRINT("TAG Read\n");
207+ DEBUGPRINT("dmFileTag3Read\n");
202208 fread(dmTag->seperator, sizeof(char), 4, fpt);
209+ DEBUGPRINT1("%s\n",dmTag->seperator);
210+ if(0!=strncmp(dmTag->seperator, "%%%%", 4)) {
211+ fprintf(stderr, "Not supported : Strange!!!\n");
212+ }
203213 fread(&(dmTag->ninfo), sizeof(dmFileInteger4), 1, fpt);
204214 #ifdef II
205215 memoryByteSwap(&(dmTag->ninfo), sizeof(dmFileInteger4), 1);
206216 #endif
207217 DEBUGPRINT1("tag ninfo %d\n", dmTag->ninfo);
218+ if(0==dmTag->ninfo) {
219+ DEBUGPRINT1("tag ninfo is zero: %d\n", dmTag->ninfo);
220+ return;
221+ }
208222 dmTag->info = (dmFileInteger4*)memoryAllocate(sizeof(dmFileInteger4)*dmTag->ninfo, "in dmFileRead");
209223 fread(dmTag->info, sizeof(dmFileInteger4), dmTag->ninfo, fpt);
210224 #ifdef II
211225 memoryByteSwap(dmTag->info, sizeof(dmFileInteger4), dmTag->ninfo);
212226 #endif
213- DEBUGPRINT1("tag: %X\n", dmTag->info[0]);
227+ DEBUGPRINT2("tag: info[0] %X ninfo %d\n", dmTag->info[0], dmTag->ninfo);
214228 switch(dmTag->info[0]) {
215229 case dmFileTagDataTypeStruct: {
216230 DEBUGPRINT1("Struct: numEntry %d\n", dmTag->info[2]);
@@ -218,7 +232,7 @@ dmFileTag3Read(FILE* fpt, dm3FileTagDirectrory* dmTag, char* message, int mode)
218232 // dmTag->info[2*n + 4] ; data type of value-n
219233 dmTag->value2 = (void*)memoryAllocate(sizeof(void*)*dmTag->info[2], "in dmFileRead");
220234 for(j=0; j<dmTag->info[2]; j++) {
221- DEBUGPRINT2("value %d %d\n", j, dmTag->info[2*j+4]);
235+ DEBUGPRINT2("value %d type %d\n", j, dmTag->info[2*j+4]);
222236 dmTag->value2[j] = memoryAllocate(__dmFileTagDataTypeSize[dmTag->info[2*j+4]], "in dmFileRead");
223237 fread(dmTag->value2[j], __dmFileTagDataTypeSize[dmTag->info[2*j+4]], 1, fpt);
224238 #ifdef II
@@ -245,11 +259,20 @@ dmFileTag3Read(FILE* fpt, dm3FileTagDirectrory* dmTag, char* message, int mode)
245259 }
246260 break;
247261 }
262+ case dmFileTagDataTypeString: {
263+ //dmTag->value = memoryAllocate(__dmFileTagDataTypeSize[dmTag->info[0]], "in dmFileRead");
264+ //fread(dmTag->value, __dmFileTagDataTypeSize[dmTag->info[0]], 1, fpt);
265+ //dmFileValuePrint(stderr, dmTag->value, __dmFileTagDataTypeSize[dmTag->info[0]], 1);
266+ //fprintf(stderr, "Not supported tagType: %d\n", dmTag->info[j]);
267+ break;
268+ }
248269 default: {
249- fprintf(stderr, "Not supported tagType: %d\n", dmTag->info[j]);
270+ dmTag->value = memoryAllocate(__dmFileTagDataTypeSize[dmTag->info[0]], "in dmFileRead");
271+ fread(dmTag->value, __dmFileTagDataTypeSize[dmTag->info[0]], 1, fpt);
272+ dmFileValuePrint(stderr, dmTag->value, __dmFileTagDataTypeSize[dmTag->info[0]], 1);
273+ //fprintf(stderr, "Not supported tagType: %d\n", dmTag->info[j]);
250274 break;
251275 }
252276 }
253277 }
254278
255-
--- a/src/Objects/DataManip/mrcImage/src/lmrcImageShapePCA.c
+++ b/src/Objects/DataManip/mrcImage/src/lmrcImageShapePCA.c
@@ -59,27 +59,44 @@ lmrcImageShapePCA(mrcImage* in, lmrcImageShapePCAInfo* linfo, int mode)
5959 arrayDataSet2(X1, 2, i, data);
6060 }
6161 arrayPCA(&linfo->u, &linfo->C, &linfo->Lambda, &X1, &linfo->Average, 0);
62+
63+ return 0;
6264 }
6365
6466 int
6567 lmrcImageShapePCAResultsPrint(FILE* fpt, lmrcImageShapePCAInfo* linfo, int mode)
6668 {
6769 double sum;
70+ double lambda[3];
71+ int i;
72+
73+ fprintf(fpt, "# PCA Results");
74+ fprintf(fpt, "Convariace Matrix: ");
75+ arrayWriteToFile(fpt, &linfo->C, "lmrcImageShapePCAResultsPrint");
76+ fprintf(fpt, "UnitVector: one unit vector per line, from 1st ");
77+ arrayWriteToFile(fpt, &linfo->u, "lmrcImageShapePCAResultsPrint");
78+ fprintf(fpt, "Lambda: 1st 2nd 3rd");
79+ arrayWriteToFile(fpt, &linfo->Lambda, "lmrcImageShapePCAResultsPrint");
80+ fprintf(fpt, "Average: ");
81+ arrayWriteToFile(fpt, &linfo->Average, "lmrcImageShapePCAResultsPrint");
82+ fprintf(fpt, "Normalized Lambda: 1st 2nd 3rd\n");
83+
84+ lambda[0] = arrayDataGet1(linfo->Lambda, 0);
85+ lambda[1] = arrayDataGet1(linfo->Lambda, 1);
86+ lambda[2] = arrayDataGet1(linfo->Lambda, 2);
87+ sum = 0;
88+ for(i=0; i<3; i++) {
89+ sum += lambda[i];
90+ }
91+ for(i=0; i<3; i++) {
92+ lambda[i] /= sum;
93+ }
94+ for(i=0; i<3; i++) {
95+ fprintf(fpt, "%15.6f ", lambda[i]);
96+ }
97+ fprintf(fpt, "\n");
98+
99+ fprintf(fpt, "logS(SphereIndex) : %15.6f\n", log10(1/(lambda[0]*lambda[1] + lambda[1]*lambda[2] +lambda[2]*lambda[0] )));
68100
69- fprintf(fpt, "# PCA Results");
70- fprintf(fpt, "Convariace Matrix: ");
71- arrayWriteToFile(fpt, &linfo->C, "lmrcImageShapePCAResultsPrint");
72- fprintf(fpt, "UnitVector: one unit vector per line, from 1st ");
73- arrayWriteToFile(fpt, &linfo->u, "lmrcImageShapePCAResultsPrint");
74- fprintf(fpt, "Lambda: 1st 2nd 3rd");
75- arrayWriteToFile(fpt, &linfo->Lambda, "lmrcImageShapePCAResultsPrint");
76- fprintf(fpt, "Average: ");
77- arrayWriteToFile(fpt, &linfo->Average, "lmrcImageShapePCAResultsPrint");
78- fprintf(fpt, "Normalized Lambda: 1st 2nd 3rd\n");
79- sum = arrayDataGet1(linfo->Lambda, 0);
80- sum += arrayDataGet1(linfo->Lambda, 1);
81- sum += arrayDataGet1(linfo->Lambda, 2);
82- fprintf(fpt, "%15.6f ", arrayDataGet1(linfo->Lambda, 0)/sum);
83- fprintf(fpt, "%15.6f ", arrayDataGet1(linfo->Lambda, 1)/sum);
84- fprintf(fpt, "%15.6f \n", arrayDataGet1(linfo->Lambda, 2)/sum);
101+ return 0;
85102 }
--- a/src/Tools/filter/dmInfo/src/dmInfo.html
+++ b/src/Tools/filter/dmInfo/src/dmInfo.html
@@ -1,18 +1 @@
1-<HTML>
2-<HEAD>
3-<TITLE>dmInfo</TITLE>
4-</HEAD>
5-<BODY>
6-<H1>dmInfo</H1>
7-<H2>Usage</H2>
8-<PRE>
9-Usage: dmInfo
10-Options:
11- [-i[nput] In (NULL ).as(inFile::dmFile ) ] :Essential :Input:dfFile(dm3|dm4)
12- [-o[utput] Out (stdout ).as(outFile::ASCII ) ] :Optional :Output:
13- [-c[onfig] configFile (NULL ).as(inFile ) ] :Optional :ConfigurationFile
14- [-m[ode] mode (0 ).as(Integer ) ] :Optional :Mode
15------ Additional Usage -----
16-</PRE>
17-</BODY>
18-</HTML>
1+/bin/bash: dmInfo: No such file or directory