matlab_mfiles

所属分类:GDI/图象编程
开发工具:matlab
文件大小:24KB
下载次数:504
上传日期:2005-05-18 16:47:56
上 传 者lmeagle01
说明:  一款不错的图像预处理程序,去噪效果比较好,用matlab6.5开发的
(one good image preprocessing procedures, denoising more effective use of development matlab6.5)

文件列表:
cnlimg.fig (22448, 2002-09-23)
cnlimg.m (4365, 2002-09-23)
columnpicker.m (969, 2002-10-27)
corr2point.m (1656, 2002-10-27)
corrallA.m (41740, 2002-10-04)
corrallB.m (41477, 2002-09-23)
corrsliceA.m (4803, 2002-10-31)
corrsliceB.m (4803, 2002-10-31)
flipimg.m (1025, 2002-10-27)
historypicker.m (1243, 2002-10-27)
imcolumnpicker.m (987, 2002-10-27)
imhistorypicker.m (1259, 2002-10-31)
impicker.m (1035, 2002-10-27)
imrowpicker.m (974, 2002-10-27)
loadimg.m (705, 2002-10-27)
mask.m (1860, 2002-09-22)
mkbshortarray.m (441, 2002-09-22)
mkmatrixrand.m (632, 2002-09-22)
picker.m (1019, 2002-10-27)
plotpair.m (961, 2002-10-18)
roislice.m (1440, 2002-10-31)
rowpicker.m (957, 2002-10-27)
test.m (26, 2002-10-21)
testabc.m (402, 2002-09-22)
zscore.m (390, 2002-09-23)

11/1/2002 M-files in the current directory D:\matlabR12\work binmask corrallA mkbshortarray rowpicker cleancorr corrallB mkmatrixrand testabc cnlimg historypicker picker zscore columnpicker loadimg plotpair corr2point mask roislice corrsliceA corrsliceB These files were developed to do the Bruce-Lee Analyses and some other random cool stuff along the way. Normal procedure would be as follows: 1) loadimg: to load a series of images into a single array. This will normally be a 4D array (if it is a functional image) with time on the 4th dimension. 2) flipimg: This will flip the array around so that the brain is oriented anterior up (instead of anterior to one side). It also flips the z-axis to match the afni display (RAI not RAS) so the slice slider will line up with the matlab values. N.B. All you have to remember is that Afni starts counting at 0 and Matlab starts counting at 1. So slice 5 in afni will be slice 6 in Matlab. For our RAS images, z in afni will simply be backwards and off by one when compared to Matlab. x and y will be off by 1 (e.g., x=22, y=15 in Afni=>x=23, y=16 in Matlab). 3) roislice: This uses functions in the image processing toolbox. It presents you with each physical slice and you mask it with the mouse. Everything outside the closed figure you draw will be set to zero. Everything inside the polygon will be preserved. This generates binI (a binary mask matched in size to the original 4D file) 4) dot multiplication: multiply binI.*each 4D file Note that the assumption here is that the 2 4D files are the same size and are aligned to each other...so typically, pre and post from the same subject. You may want to give this a new name, e.g., pre_masked=binI.*pre 5) corrallA: Apply this to the output of the dot multiplication for the "pre" case(e.g., pre_masked). Everything will be named with an A to mark it as "pre". This generates rr1A.mat, rr2A.mat etc., (one correlation matrix for each slice). 5.1) corrsliceA: Same as above, but the user specifies a single slice for correlation. 6) corrallB: Apply this to the output of the dot multiplication for the "post" case(e.g., post_masked). Everything will be named with an B to mark it as "post". This generates rr1B.mat, rr2B.mat etc., (one correlation matrix for each slice). 6.1) Same as above, but the user specifies a single slice for correlation 7) cleancorr: Input each rr*.mat file by specifying the slice number only. Both pre and post (A and B) will be automatically cleaned for that slice. In this way, they'll remain perfectly matched to each other (i.e., for a given slice, the number of voxels compared will be exactly equivalent AND the same paired comparisons pre and post will appear in the same order.) Output will be saved as A1.mat, B1.mat, containing A and B respectively. It is assumed that subsequent operations will not require having differently numbered A mat files open at the same time since they'd overwrite each other. 8) plotpair: For each each A*.mat and B*.mat pair, run plotpair, simply by specifying the slice number. The cleaned vectors (e.g., A*.mat and B*.mat) will be loaded and plotted as a red and blue lines tracing the histograms of each mat file, complete with a legend. From these plots, you can identify a shift in the number of positively or negatively correlated voxels in the ROI. For example, in the pre-post water example we see that post, there is a shift towards more 0 correlations...this may be the result of the practice effect. ************************************************************************************ Picker Toys 1) picker: pick any number of points in a slice and then hit enter. Picker will display a 3 column output: the x coordinate the y coordinate the intensity value at that x-y point 2) rowpicker: pick any number of rows by clicking at any point along the rows. Hit enter. For each row (i.e., for each Left to Right row, regardless of the orientation of the image, a figure is displayed showing a line plot of intensities along that row of the slice. Figures will be numbered in order, beginning with the first row you chose. 3) columnpicker: same as rowpicker, but chooses line plot of the column 4) historypicker: Like column and rowpicker, but plots intensity values along the 4th (time) dimension. ******************************************************************************** Mask Toys 1) mask: Automatically identifies a threshold (.75 * global mean) and sets all values below the threshold to 0 (zero). This does a fairly decent job of identifying the edge of the head but may leave ghost artifacts as acceptable above threshold values. Generates "maskedarray", the original image with low values set to zero. 2) binmask: Same as mask, but sets above-threshold values to 1 instead of their original intensities. The output file is called "binarray". ********************************************************************************** Misc 1) corr2point: allows you to pick an individual point and then correlates the history of that voxel to the other voxels in the slice. Corr2point outputs a colored surface map of correlations, the biggest spike being the voxel you picked (since it is perfectly correlated to itself). This does not depend on the image processing toolbox. 2) zscore: Outputs a new file "z", the same size as the original image, with all values converted to z-scores. 3) mkbshortarray: Permutes the 3rd and 4th dimensions of the 4D input array. Given that the input was a standard set of spm files (the 3rd dim corresponds to the physical "z-axis" and the 4th dim corresponds to time), mkbshortarray will make the 3rd dim time and the 4th the z-axis. This latter ordering is more consistent with the mgh "bshort" format. 4) mkmatrixrand: Makes a 4D matrix of random numbers, it'll ask the user for the size of each dimension (useful for testing stuff). 5) cnlimg: The fig and m files together form a simple user interface from which the user can call up some of the programs listed to this point...interesting, but probably not that useful for serious work. ***********************************************************************************

近期下载者

相关文件


收藏者