Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FOR STUFF TO BE IN THE RIGHT DIRECTORY
- >> pwd
- ans =
- '/Users/Charlotte/Documents/MATLAB'
- >> ls
- MATLAB stuff
- >> cd 'MATLAB stuff'/
- >> ls
- ratio30
- >> cd ratio30/
- >>
- clear all; close all; clc
- global MAXMEM; MAXMEM=256;
- surf = SurfStatReadSurf( 'av.obj' );
- mask = SurfStatMaskCut( surf );
- maskb = (mask & SurfStatROI([0; -16; -8], 20, surf ) == 0);
- [subject, RatioLeft, RatioRight, gender, age, scanner]...
- =textread('GLIMV123ratiowomissingSTRINGENT.csv', '%s %s %s %s %f %s');
- clf; hist(age); xlabel('age')
- R1 = SurfStatReadData( [RatioLeft] );
- R2 = SurfStatReadData( [RatioRight] );
- R3 = horzcat(R1, R2);
- Age = term( age );
- Gender = term ( gender );
- Scanner = term (scanner );
- Subject = term ( subject );
- Ml = 1 + Age + Gender + random( Subject ) + I;
- Mq = 1 + Age + (Age)^2 + Gender + random( Subject ) + I;
- Mc = 1 + Age + (Age)^2 + (Age)^3 + Gender + random( Subject ) + I;
- slm = SurfStatLinMod( R3, Ml, surf );
- SurfStatView( slm.r.*mask, surf, 'Linear Model' );
- slm = SurfStatT ( slm, Age);
- slm = SurfStatT (slm, -age);
- % if want to look at T val
- (SurfStatView ( slm.t.*maskb, surf, ' TVAL' );)
- [ pval, peak, clus ] = SurfStatP( slm, maskb );
- SurfStatView( pval, surf, 'PVAL LINEAR');
- % QUICK WAY TO BYPASS THIS SHIT
- slm = SurfStatT( SurfStatLinMod( R3, 1 + Age + Gender + random( Subject ) + I, surf ), Age );
- [ pval, peak, clus, clusid ] = SurfStatP( slm, mask );
- SurfStatView( pval, surf, 'PVAL LINEAR' );
- %THEN CLICK ON POINT OF INTEREST
- %THEN EITHER GET THE POINT WITH 10mm around OR
- %GET THE AREA
- >> maskROI = SurfStatROI( 67864, 10, surf );
- >> reselsROI = SurfStatResels( slm, maskROI );
- >> MlROI = mean( R3(:, maskROI), 2 );
- >> SurfStatPlot( Age, MlROI, Gender );
- %HOW TO DO THE CLUSTER ID WITHOUT EXCEEDING MATRIX SIZE
- %HOW TO DO AN AVERAGE OF THE RATIOS IN THE REGION OF INTEREST??
- EXAMPLE::
- >> global MAXMEM; MAXMEM=256;
- surf = SurfStatReadSurf( 'av.obj' );
- mask = SurfStatMaskCut( surf );
- maskb = (mask & SurfStatROI([0; -16; -8], 20, surf ) == 0);
- [subject, RatioLeft, RatioRight, gender, age, scanner]...
- =textread('GLIMV123ratio2ALLwomissingwoqcmarker.csv', '%s %s %s %s %f %s');
- clf; hist(age); xlabel('age')
- R1 = SurfStatReadData( [RatioLeft] );
- R2 = SurfStatReadData( [RatioRight] );
- R3 = horzcat(R1, R2);
- 752 x 1 files to read, % remaining: 100 90 80 70 60 50 40 30 20 10 0 Done
- 752 x 1 files to read, % remaining: 100 90 80 70 60 50 40 30 20 10 0 Done
- >> Age = term( age );
- Gender = term ( gender );
- Scanner = term (scanner );
- Subject = term ( subject );
- >>
- >> slm = SurfStatT( SurfStatLinMod( R3, 1 + Age + Gender + random( Subject ) + I, surf ), Age );
- [ pval, peak, clus, clusid ] = SurfStatP( slm, mask );
- SurfStatView( pval, surf, 'PVAL LINEAR' );
- >> slm = SurfStatT( SurfStatLinMod( R3, 1 + Age + Gender + random( Subject ) + I, surf ), Age );
- [ pval, peak, clus, clusid ] = SurfStatP( slm, mask );
- SurfStatView( pval, surf, 'Linear model positive T value' );
- id =
- 25439
- >>
- clusid( 25439 )
- ans =
- 5
- >> maskROI = clusid == clusid( 25439 );
- >> Linearmodelcluster5 = mean( R3(:, maskROI), 2 );
- >> SurfStatPlot( Age, Linearmodelcluster5, Gender );
- SO
- Linear with Age, screenshot positive correlations
- Then get average ratio in every cluster that comes out and plot against age
- Linear with –age, screenshot negative correlations
- Then get average ratio in every cluster that comes out and plot against age.
- THE ISSUE OF ADJUSTING FOR GENDER… SHOULD I DO IT FOR MEN AND WOMEN?? THEN HOW?? DIVIDE MY DATA IN MEN AND WOMEN??
- CAN ALSO COMBINE ROIs in their clusters to make one big one.
- CAN YOU GET A WAY FOR ALL THE CLUSTERS TO COME OUT OR YOU DO IT VISUALLY?
- TO COMBINE ROIS, allows you to do the
- maskROI = maskROI1 | maskROI2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement