Changeset 19756
- Timestamp:
- Sep 25, 2008, 11:27:11 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/ppStack/src/ppStackLoop.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStack/src/ppStackLoop.c
r19745 r19756 188 188 bool mdok; // Status of MD lookup 189 189 bool tempDelete = psMetadataLookupBool(&mdok, recipe, "TEMP.DELETE"); // Delete temporary files? 190 const char *tempDir = psMetadataLookupStr(NULL, recipe, "TEMP.DIR"); // Directory for temporary images 191 if (!tempDir) { 192 psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Unable to find TEMP.DIR in recipe"); 193 return false; 194 } 195 const char *tempName = psMetadataLookupStr(NULL, config->arguments, "OUTPUT"); // Name for temporary files 196 tempName = basename(tempName); 197 if (!tempName) { 198 psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Unable to construct basename for temporary files."); 199 return false; 200 } 201 190 202 const char *tempImage = psMetadataLookupStr(NULL, recipe, "TEMP.IMAGE"); // Suffix for temporary images 191 203 const char *tempMask = psMetadataLookupStr(NULL, recipe, "TEMP.MASK"); // Suffix for temporary masks 192 204 const char *tempWeight = psMetadataLookupStr(NULL, recipe, "TEMP.WEIGHT"); // Suffix for temp weight maps 193 205 if (!tempImage || !tempMask || !tempWeight) { 194 psError(PS_ERR_BAD_PARAMETER_VALUE, true,206 psError(PS_ERR_BAD_PARAMETER_VALUE, false, 195 207 "Unable to find TEMP.IMAGE, TEMP.MASK and TEMP.WEIGHT in recipe"); 196 208 return false; … … 368 380 memDump("psf"); 369 381 370 const char *outName = psMetadataLookupStr(NULL, config->arguments, "OUTPUT"); // Output root371 assert(outName);372 382 psArray *imageNames = psArrayAlloc(num); 373 383 psArray *maskNames = psArrayAlloc(num); … … 375 385 for (int i = 0; i < num; i++) { 376 386 psString imageName = NULL, maskName = NULL, weightName = NULL; // Names for convolved images 377 psStringAppend(&imageName, "%s.%d.%s", outName, i, tempImage); 378 psStringAppend(&maskName, "%s.%d.%s", outName, i, tempMask); 379 psStringAppend(&weightName, "%s.%d.%s", outName, i, tempWeight); 387 psStringAppend(&imageName, "%s/%s.%d.%s", tempDir, tempName, i, tempImage); 388 psStringAppend(&maskName, "%s/%s.%d.%s", tempDir, tempName, i, tempMask); 389 psStringAppend(&weightName, "%s/%s.%d.%s", tempDir, tempName, i, tempWeight); 390 psTrace("ppStack", 5, "Temporary files: %s %s %s\n", imageName, maskName, weightName); 380 391 imageNames->data[i] = imageName; 381 392 maskNames->data[i] = maskName;
Note:
See TracChangeset
for help on using the changeset viewer.
