Skip to content

Commit

Permalink
Deploying to demo from @ bc86da6 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
neurolabusc committed Jun 11, 2024
1 parent 2407981 commit 190f569
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 20 deletions.
34 changes: 17 additions & 17 deletions assets/index-CxBnCt_J.js → assets/index-BncYhJ_J.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="./niivue.css" />
<title>Niivue Neglect Predictions</title>
<script type="module" crossorigin src="./assets/index-CxBnCt_J.js"></script>
<script type="module" crossorigin src="./assets/index-BncYhJ_J.js"></script>
</head>

<body>
Expand Down
Binary file removed mask_vox.nii.gz
Binary file not shown.
15 changes: 13 additions & 2 deletions neglect_predict.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ function neglect_predict(fnm, acuteCoC)
maskVox = uint8(maskVox012 > 1);
ROI_volVox = nnz(maskROI & lesion);
ROI_volML = ROI_volVox / 1000; %convert voxels to ML
fprintf("%d lesioned voxels in ROI mask: %g ml\n", ROI_volVox, ROI_volML);
lesionVolTotalML = nnz(lesion) / 1000; %convert voxels to ML
% fprintf("%d lesioned voxels in ROI mask: %g ml\n", ROI_volVox, ROI_volML);
%PCA
fnmPCA = fullfile(mpath, 'pca_values_5x21220.mat');
if ~exist(fnmPCA,'file')
Expand Down Expand Up @@ -89,7 +90,17 @@ function neglect_predict(fnm, acuteCoC)
end
% Calculate mean prediction
prediction_mean = mean(predictions_mdls);
disp(['Mean prediction: ' num2str(prediction_mean)]);
diffZ = prediction_mean * (38.72560594 + 1.211389735) - 1.211389735;
% calculate acute z-score based on user input CoC
acuteZ = (acuteCoC - 0.00803)/0.0216; % mean/SD of controls
% calculate chronic z-score that can be interpreted by the user
chronZ = acuteZ-diffZ;
chronCoC = chronZ * 0.0216 + 0.00803;
% output text
% "Acute z-score = xxx; z-score difference (predicted) = xxx; chronic z-score = xxx.
% The predicted score represents the direct improvement between acute and chronic stroke phase (i.e. acute z-score minus chronic z-score). Negative values and a z-score % of about 0 indicate no deficit; the larger the z-score, the more severe the neglect behavior."
str = sprintf('Given %gml lesion (with %g in core neglect voxels), and acute CoC %g (z= %g), predicted chronic CoC is %g (z= %g)\n', lesionVolTotalML, ROI_volML, acuteCoC, acuteZ, chronCoC, chronZ);
disp(str);
end
function ret = norm0to1(val, mn, mx)
%return normalized 0..1, linearly interpolated min..max
Expand Down

0 comments on commit 190f569

Please sign in to comment.