1. 图像增强
1)使用软件fiji优化图片序列
直接运行exe文件
imageJ:ImageJ
-
原始图像:
image.png
-
仅修改 blocksize:第一次
image.png
Process / Enhance Local Contrast (CLAHE). The filter respects the selected regions of interest and triggers an Undo-step.
The method has three parameters:
block size
the size of the local region around a pixel for which the histogram is equalized. This size should be larger than the size of features to be preserved.histogram bins
the number of histogram bins used for histogram equalization. The implementation internally works with byte resolution, so values larger than 256 are not meaningful. This value also limits the quantification of the output when processing 8bit gray or 24bit RGB images. The number of histogram bins should be smaller than the number of pixels in a block.max slope
limits the contrast stretch in the intensity transfer function. Very large values will let the histogram equalization do whatever it wants to do, that is result in maximal local contrast. The value 1 will result in the original image.
In addition, the PlugIn asks for:mask
choose, from the currently opened images, one that should be used as a mask for the filter application. Selections and masks can be used exclusively or in combination.fast
use the fast but less accurate version of the filter. The fast version does not evaluate the intensity transfer function for each pixel independently but for a grid of adjacent boxes of the given block size only and interpolates for locations in between.
-
第二次
image.png
-
第三次
image.png
-
第四次
image.png
3)使用fiji脚本批量处理一组图片
使用fiji打开图片序列文件16-T2N2,33+_post_waterT1C.nii.gz,
脚本编程,使用Fiji's scripting editor
参考资料:
<u>https://imagej.net/Enhance_Local_Contrast_%28CLAHE%29</u>
<u>https://imagej.net/Using_the_Script_Editor</u>
语言选择IJ1 Macro , run脚本,调整3个参数。脚本如下:
blocksize = 127;
histogram_bins = 256;
maximum_slope = 3;
mask = "None";
fast = true;
process_as_composite = true;
getDimensions( width, height, channels, slices, frames );
isComposite = channels > 1;
parameters =
"blocksize=" + blocksize +
" histogram=" + histogram_bins +
" maximum=" + maximum_slope +
" mask=" + mask;
if ( fast )
parameters += " fast_(less_accurate)";
if ( isComposite && process_as_composite ) {
parameters += " process_as_composite";
channels = 1;
}
for ( f=1; f<=frames; f++ ) {
Stack.setFrame( f );
for ( s=1; s<=slices; s++ ) {
Stack.setSlice( s );
for ( c=1; c<=channels; c++ ) {
Stack.setChannel( c );
run( "Enhance Local Contrast (CLAHE)", parameters );
}
}
}
- 使用方法:
- 将文件夹拖入FIJI框中,run脚本
-
第一次:
image.png -
第二次:
image.png -
第三次:
image.png -
第四次:
image.png