00001
00012 #ifndef CSU_FILE_COMMON_INCLUDED
00013 #define CSU_FILE_COMMON_INCLUDED
00014
00015 #include "csuCommon.h"
00016 namespace csu{
00017
00018
00019 typedef char** ListOfStrings;
00020
00044 typedef struct image_list_node {
00045 char* filename;
00046 int imageIndex;
00047 struct image_list_node* next_replicate;
00048 struct image_list_node* next_subject;
00049 }
00050 ImageList;
00051
00052
00053
00054 char *makePath (const char *directoryName, const char *fileName);
00055 void checkWriteableDirectory (const char *directory, const char *message);
00056 void checkReadableDirectory (const char *directory, const char *message);
00057 void checkReadableFile (const char *file, const char *message);
00058
00059 ListOfStrings readListOfStrings (const char *fileName, int *nStrings);
00060 void freeListOfStrings (ListOfStrings list);
00061
00062 void sortSubjectsBySimilarityToProbe (char *probe, ListOfStrings subjects, char *distanceMatrix, int *indices);
00063
00064 void readFile(const char *fname, int n, Matrix images);
00065 ImageList* getImageNames(char* imageNamesFile, int *numImages);
00066 void freeImageNames (ImageList *list);
00067 Matrix readImages(char *imageNamesFile, char *imageDirectory, int *numPixels, int *numImages, int *numSubjects, ImageList **srt);
00068 void readFile(const char *fname, int n, Matrix images);
00069
00070 int numImageInImageList(ImageList *srt);
00071 int autoFileLength(const char* imageName);
00072
00073 float *readFeretRaster(const char *fn, int numpix);
00074 float *writeFeretRaster(const char *fn, float *data, int numpix);
00075
00076 unsigned char *readImagePGM(const char *filename, int *w, int *h, int verbose);
00077 void writeImagePGM(const char *fn, float *data, int numpix, int w, int h);
00078 }
00079 #endif
00080
00081
00082
00083