void setStage(struct imageInfo *image, char *flakyClone, char *flakyStage) /* Set image->stage from stage name if it looks good. */ { flakyStage = skipLeadingSpaces(flakyStage); /* Strip out -all suffix if any. */ stripSuffix(flakyStage, "-all"); stripSuffix(flakyStage, "-2"); stripSuffix(flakyStage, "-12"); if (startsWith("St", flakyStage)) { char *num = flakyStage+2; int numSize = strlen(num); if (isdigit(num[0]) && isdigit(num[1])) { if (numSize == 2 || (numSize == 4 && num[2] == '.' && isdigit(num[3]))) image->stage = flakyStage; } } if (image->stage == NULL) { if (sameString(flakyStage, "St105")) image->stage = "St10.5"; else if (sameString(flakyStage, "St8")) image->stage = "St8"; else if (sameString(flakyStage, "St9")) image->stage = "St9"; else if (sameString(flakyStage, "St10-1")) image->stage = "St10"; else if (sameString(flakyStage, "St12a")) image->stage = "St12"; else if (sameString(flakyStage, "S20")) image->stage = "St20"; else if (sameString(flakyStage, "S24")) image->stage = "St24"; else if (sameString(flakyStage, "S25")) image->stage = "St25"; } }
struct imageInfo *getImageInfo(struct hash *fixHash, char *cloneName, char *dir, char *subDir, char *file, struct hash *stageHash, struct hash *viewHash, struct hash *otherHash, struct hash *probeHash) /* Work on a single image file. */ { char *fixedFile; char *dupeFileName; char *s, *e; struct imageInfo *image; /* Allocate imageInfo and save stuff that requires no * correction. */ AllocVar(image); image->clone = cloneName; image->dir = dir; image->subDir = subDir; image->file = file; /* Do the straight lookup type correction. */ fixedFile = hashFindVal(fixHash, file); if (fixedFile != NULL) file = fixedFile; /* Get a copy of file name to work on as we chew * through the correction process. */ dupeFileName = cloneString(file); s = dupeFileName; /* Get rid of .jpg suffix, we don't care. */ chopSuffix(s); /* A lot of them end with trans or sence_trans, which * refers I think to some varients in the preparation. * We'll just skip this part if it's there. */ stripSuffix(s, "_trans"); stripSuffix(s, "_sence"); /* Generally the rest of the file name is broken up into * parts by underbars. We'll use the e and s variables * to point to the beginning and end of the current underbar * separated word. */ e = strchr(s, '_'); if (e == NULL) { /* Here there is just a single word. Usually it * is "all" which we'll interpret as meaning the photo * is a mixture of developmental stages and views. * Sometimes it will be the clone name followed by all. */ hashStore(otherHash, s); if (startsWith("XL", s) && sameString(s+8, "all")) s += 8; setAllishStages(s, image); } else { /* The clone name from the file name is less reliable * than the clone name from the directory, so mostly we'll * just skip it. Sometimes we'll have to use it to dig out * the stage name when they forgot the underbar. */ char *flakyClone = s; char *flakyStage = NULL, *flakyView = NULL; *e++ = 0; if (startsWith("XL178i11St", flakyClone)) { /* This guy forgot the underbar. */ s += 8; } else s = e; if (*s == '_') /* Sometimes they mess up and put in 2 underbars. */ ++s; else if (startsWith("S_", s)) /* Or put in a gratuitious S_ */ s += 2; else if (startsWith("AS_", s)) /* Or put in a gratuitious AS_ */ s += 3; flakyStage = s; /* At this point flakyStage (and s) point to a part of the * file name that contains the developmental stage, which * is normally in the format "St" followed by a number. * However there's a chance there will just be the word * all here, which again we interpret as the photo being * mixed stages. */ e = strchr(s, '_'); if (e == NULL) { hashStore(otherHash, s); setAllishStages(s, image); if (image->stage == NULL) { setStage(image, flakyClone, flakyStage); image->view = "mixed"; } } else { *e++ = 0; hashStore(stageHash, s); setStage(image, flakyClone, flakyStage); s = e; flakyView = s; hashStore(viewHash, s); setView(image, flakyClone, flakyStage, flakyView); } } return image; }
string WMUtils::makeFunctionsFilename(string filename) { string prefix = stripSuffix(filename); prefix.append(WMANALYSISFUNCTIONS); return prefix; }
string WMUtils::makeAllocationsFilename(string filename) { string prefix = stripSuffix(filename); prefix.append(WMANALYSISALLOCATIONS); return prefix; }
string WMUtils::makeGraphFilename(string filename) { string prefix = stripSuffix(filename); prefix.append(WMANALYSISGRAPH); return prefix; }