Changeset 26622
- Timestamp:
- Jan 18, 2010, 6:21:02 AM (16 years ago)
- File:
-
- 1 edited
-
trunk/magic/remove/src/streaksremove.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/magic/remove/src/streaksremove.c
r26477 r26622 197 197 psMetadataAddF32(sfiles->stats, PS_LIST_TAIL, "CENSOR_SOURCES", PS_META_REPLACE, "", cs_t); 198 198 199 200 199 // write the destreaked "temporary" images and the recovery images 201 200 psTimerStart("WRITE_IMAGES"); … … 205 204 206 205 psLogMsg("streaksremove", PS_LOG_INFO, "time to process component %d: %f\n", sfiles->extnum, psTimerClear("PROCESS_COMPONENT")); 206 207 207 } while (streakFilesNextExtension(sfiles)); 208 208 … … 686 686 } else { 687 687 // we have an image cube 688 double initValue;689 688 if (exciseImageCube) { 690 689 // copy the entire input image to the recovery image 691 690 writeImageCube(sf->recImage, sf->inImage->imagecube, extname, sf->extnum); 692 initValue = NAN;693 691 } else { 694 692 // otherwise write it to the output 695 693 writeImageCube(sf->outImage, sf->inImage->imagecube, extname, sf->extnum); 696 initValue = 0; 697 } 698 699 // borrow one of the images from the imagecube and set it to init value 700 psImage *image = psArrayGet (sf->inImage->imagecube, 0); 701 psMemIncrRefCounter(image); 702 psImageInit(image, initValue); 694 } 695 696 // Now deal with the other output image 703 697 if (exciseImageCube) { 704 sf->outImage->image = image; 705 writeImage(sf->outImage, extname, sf->extnum); 698 // Set the values in the imagecube images to NAN and write them to the output image 699 for (int i = 0; i < psArrayLength(sf->inImage->imagecube); i++) { 700 psImage *image = psArrayGet (sf->inImage->imagecube, i); 701 // XXX: NAN isn't right. It should be the integer equivalent. Should use exciseValue 702 // but it isn't set with this code path. Fix that. 703 psImageInit(image, 65535); 704 } 705 writeImageCube(sf->outImage, sf->inImage->imagecube, extname, sf->extnum); 706 706 } else { 707 // write zero valued image to reccovery708 707 if (sf->recImage) { 709 sf->recImage->image = image; 710 writeImage(sf->recImage, extname, sf->extnum); 708 // Set the values in the imagecube images to zero 709 for (int i = 0; i < psArrayLength(sf->inImage->imagecube); i++) { 710 psImage *image = psArrayGet (sf->inImage->imagecube, i); 711 psImageInit(image, 0); 712 } 713 // copy the entire zeroed image to the recovery image 714 writeImageCube(sf->recImage, sf->inImage->imagecube, extname, sf->extnum); 711 715 } 712 716 } … … 739 743 } 740 744 741 float imageValue = sfiles->inImage->image->data.F32[y][x]; 742 if (sfiles->recImage && !isExciseValue(imageValue, sfiles->inImage->exciseValue) ) { 743 sfiles->recImage->image->data.F32[y][x] = imageValue; 744 } 745 746 if (sfiles->transparentStreaks == 0) { 747 sfiles->outImage->image->data.F32[y][x] = exciseValue; 745 if (sfiles->inImage->image->type.type == PS_TYPE_U16) { 746 psU16 imageValue = sfiles->inImage->image->data.U16[y][x]; 747 if (sfiles->recImage && !isExciseValue(imageValue, sfiles->inImage->exciseValue) ) { 748 sfiles->recImage->image->data.U16[y][x] = imageValue; 749 } 750 751 if (sfiles->transparentStreaks == 0) { 752 sfiles->outImage->image->data.U16[y][x] = exciseValue; 753 } else { 754 if (streak) { 755 // as a visualization aid don't mask the pixel, just change the intensity 756 sfiles->outImage->image->data.U16[y][x] = imageValue + sfiles->transparentStreaks; 757 } else { 758 sfiles->outImage->image->data.U16[y][x] = exciseValue; 759 } 760 } 748 761 } else { 749 if (streak) { 750 // as a visualization aid don't mask the pixel, just change the intensity 751 sfiles->outImage->image->data.F32[y][x] = imageValue + sfiles->transparentStreaks; 762 float imageValue = sfiles->inImage->image->data.F32[y][x]; 763 if (sfiles->recImage && !isExciseValue(imageValue, sfiles->inImage->exciseValue) ) { 764 sfiles->recImage->image->data.F32[y][x] = imageValue; 765 } 766 767 if (sfiles->transparentStreaks == 0) { 768 sfiles->outImage->image->data.F32[y][x] = exciseValue; 752 769 } else { 753 sfiles->outImage->image->data.F32[y][x] = exciseValue; 770 if (streak) { 771 // as a visualization aid don't mask the pixel, just change the intensity 772 sfiles->outImage->image->data.F32[y][x] = imageValue + sfiles->transparentStreaks; 773 } else { 774 sfiles->outImage->image->data.F32[y][x] = exciseValue; 775 } 754 776 } 755 777 }
Note:
See TracChangeset
for help on using the changeset viewer.
