Changeset 28566
- Timestamp:
- Jun 30, 2010, 4:53:55 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/ppSub/src/ppSubConvolve.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppSub/src/ppSubConvolve.c
r27370 r28566 29 29 ) 30 30 { 31 if (!name) { 32 return; 33 } 31 34 psArray *files = psArrayAlloc(1); // Array with file names 32 35 files->data[0] = psStringCopy(name); … … 53 56 psMetadataAddStr(arguments, PS_LIST_TAIL, "-image", 0, "Input image", NULL); 54 57 psMetadataAddStr(arguments, PS_LIST_TAIL, "-mask", 0, "Input mask", NULL); 58 psMetadataAddStr(arguments, PS_LIST_TAIL, "-variance", 0, "Input variance", NULL); 55 59 psMetadataAddStr(arguments, PS_LIST_TAIL, "-kernel", 0, "Convolution kernel", NULL); 56 60 psMetadataAddBool(arguments, PS_LIST_TAIL, "-reference", 0, "Input is actually reference?", false); 57 61 psMetadataAddS32(arguments, PS_LIST_TAIL, "-threads", 0, "Threads to use", 0); 62 psMetadataAddBool(arguments, PS_LIST_TAIL, "-save-all", 0, "Save all outputs?", false); 58 63 59 64 if (argc == 1 || !psArgumentParse(arguments, &argc, argv) || argc != 2) { … … 63 68 const char *inImage = psMetadataLookupStr(NULL, arguments, "-image"); // Input image 64 69 const char *inMask = psMetadataLookupStr(NULL, arguments, "-mask"); // Input mask 70 const char *inVariance = psMetadataLookupStr(NULL, arguments, "-variance"); // Input variance 65 71 const char *inKernel = psMetadataLookupStr(NULL, arguments, "-kernel"); // Input kernel 66 72 if (!inImage || !inKernel) { … … 72 78 fileList("PPSUB.INPUT", inImage, "Input image", config); 73 79 fileList("PPSUB.INPUT.MASK", inMask, "Input mask", config); 80 fileList("PPSUB.INPUT.VARIANCE", inVariance, "Input variance", config); 74 81 fileList("PPSUB.INPUT.KERNEL", inKernel, "Input kernel", config); 75 82 psMetadataAddStr(config->arguments, PS_LIST_TAIL, "OUTPUT", 0, "Name of the output image", argv[1]); … … 81 88 goto die; 82 89 } 83 pmFPAfile *mask = pmFPAfileBindFromArgs(&status, image, config, "PPSUB.INPUT.MASK", 84 "PPSUB.INPUT.MASK"); 85 if (!mask || !status || mask->type != PM_FPA_FILE_MASK) { 86 psError(PPSUB_ERR_CONFIG, false, "Unable to define input mask file."); 87 goto die; 90 if (inMask) { 91 pmFPAfile *mask = pmFPAfileBindFromArgs(&status, image, config, "PPSUB.INPUT.MASK", 92 "PPSUB.INPUT.MASK"); 93 if (!mask || !status || mask->type != PM_FPA_FILE_MASK) { 94 psError(PPSUB_ERR_CONFIG, false, "Unable to define input mask file."); 95 goto die; 96 } 97 } 98 if (inVariance) { 99 pmFPAfile *variance = pmFPAfileBindFromArgs(&status, image, config, "PPSUB.INPUT.VARIANCE", 100 "PPSUB.INPUT.VARIANCE"); 101 if (!variance || !status || variance->type != PM_FPA_FILE_VARIANCE) { 102 psError(PPSUB_ERR_CONFIG, false, "Unable to define input variance file."); 103 goto die; 104 } 88 105 } 89 106 … … 101 118 } 102 119 output->save = true; 120 121 if (psMetadataLookupBool(NULL, arguments, "-save-all")) { 122 pmFPAfile *outMask = pmFPAfileDefineOutput(config, output->fpa, "PPSUB.INPUT.CONV.MASK"); 123 if (!outMask || outMask->type != PM_FPA_FILE_MASK) { 124 psError(PPSUB_ERR_CONFIG, false, "Unable to define output mask file."); 125 goto die; 126 } 127 outMask->save = true; 128 129 pmFPAfile *outVar = pmFPAfileDefineOutput(config, output->fpa, "PPSUB.INPUT.CONV.VARIANCE"); 130 if (!outVar || outVar->type != PM_FPA_FILE_VARIANCE) { 131 psError(PPSUB_ERR_CONFIG, false, "Unable to define output variance file."); 132 goto die; 133 } 134 outVar->save = true; 135 } 103 136 } 104 137
Note:
See TracChangeset
for help on using the changeset viewer.
