Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scaling of data #92

Open
aTrotier opened this issue Jul 8, 2022 · 0 comments
Open

Scaling of data #92

aTrotier opened this issue Jul 8, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@aTrotier
Copy link
Contributor

aTrotier commented Jul 8, 2022

BART scales the data before performing the CS reconstruction (see). I found that very usefull because most of the time the "optimal" regularizations factor is consistent ( around 0.01).

Do you think it is a good idea to implement that as well ?

My student wrote most of the BART function in matlab if required

function scaling = get_bart_scaling(kdata,calib_dim)
% kdata : ordered kspace data ready to be reconstructed using bart
% calib_dim : dimensions of fully sampled center of kspace,
% calib_dim=[dim1,dim2,dim3], default is [32 32 32]
if (nargin<2); calib_dim=[32 32 32] ; end

kcenter=kdata((size(kdata,1)/2-calib_dim(1)/2-1):(size(kdata,1)/2+calib_dim(1)/2-2),(size(kdata,2)/2-calib_dim(2)/2+1):(size(kdata,2)/2+calib_dim(2)/2),(size(kdata,3)/2-calib_dim(3)/2+1):(size(kdata,3)/2+calib_dim(3)/2),:,:,1,1);
im_center=bart('fft -u -i 7',kcenter);
rss_center=bart('rss 8',im_center);
rescale=sqrt(size(kdata,1)/calib_dim(1))*sqrt(size(kdata,2)/calib_dim(2))*sqrt(size(kdata,3)/calib_dim(3));
rss_sorted=sort(rss_center(:))/rescale;
if (rss_sorted(end) - rss_sorted(round(end*0.9))) < 2 * (rss_sorted(round(end*0.9)) - rss_sorted(round(end/2)))
    scaling = rss_sorted(round(end*0.9));
else
    scaling = rss_sorted(end);
end

end
@aTrotier aTrotier added the enhancement New feature or request label Jul 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant