steenmoeller / nordic_raw Goto Github PK
View Code? Open in Web Editor NEWMatlab code for performing image reconstruction in MRI and performing the NORDIC denoising
License: Other
Matlab code for performing image reconstruction in MRI and performing the NORDIC denoising
License: Other
Currently the logic of the code is hard to parse for a human because there is no systematic indentation applied to the code.
This could be very easily solved in MATLAB by simply running 'CTRL + A' and then 'CTRL + I' on the files in the repository.
Line 288 in 0aac63c
Description:
I noticed a typo in the variable name KKSP2 in the NIFTI_NORDIC.m file. On line 288 of the file, KKSP2 is used, but it is not defined or used anywhere else in the code. It appears that this variable should actually be KSP2 based on its usage in other parts of the code.
I wanted to confirm if this typo could potentially cause any issues with the final processed data. If there are no other dependencies or calculations specifically related to KKSP2, it should be safe to replace it with KSP2 for consistency.
Steps to Reproduce:
Open the NIFTI_NORDIC.m file.
Go to line 288.
Expected Behavior:
The variable name KKSP2 should likely be KSP2 based on its usage in other parts of the code.
I've come across an issue in the NIFTI_NORDIC.m file when using the kernel_size_gfactor option while ARG.use_magn_for_gfactor not provided. (default = 0)
The error appears to be related to an index issue in the following line of code:
Line 351 in 0aac63c
Although kernel_size_gfactor is considered a 3-valued array, the code at this line attempts to access the 4th element, causing the program to crash due to an index error.
I'm not entirely sure about the intent of this code segment. Looking at the commented out code, it previously used the 3rd element of the array, so I'm wondering if the current code is meant to take an optional 4-element array for kernal_size_gfactor when a phase image is being used?
I appreciate any insight you could provide on this matter. Thanks!
P.S: My colleagues and I are thrilled about NORDIC, and we intend to incorporate it into our animal fMRI preprocessing pipeline. In light of this, I've compiled NORDIC into a Python library using MATLAB Compiler SDK and updated my forked repository of this project on GitHub. As I understand the licensing terms, I realize the need for caution while sharing such derivative work. Therefore, I have made efforts to accurately state the license in the README.md document of my repository (https://github.com/dvm-shlee/nordic_cli). Could you please review my repository and verify whether my statements are in line with the licensing terms as stated in your repository?
Should there be any requirement for updates or changes, I would be grateful if you could inform me.
I suspect this is a left over from aliasing squeeze
into sq
The issue never appeared as this is part of some dead sub-function that never gets called: sub_create_NVR_file_HCP
$ cat NORDIC.m | grep sq\(
Q=sq(abs(KSP2(end-3,3:end-3,:,end))); Q1=mean(Q(:)); % take image noise from the bottom of the volume, where the signal is lowest - JIC
Q=sq(abs(KSP2(end-3,3,:,:))); Q1=mean(Q(:)); % take image noise from the bottom of the volume, where the signal is lowest - JIC
Q=sq(abs(KSP_NOISE(:,:,:,end))); Q11=mean(Q(:));
Q=sq((KSP2(end-3,2,:,:))); Q1a=mean(abs(Q(:))); % take image noise from the bottom of the volume, where the signal is lowest - JIC
Q=sq((KSP2(end-3,end-2,:,:))); Q1b=mean(abs(Q(:))); Q1=min(Q1a,Q1b);
Q=sq((KSP_NOISE(:,:,:,end))); Q11=mean(abs(Q(:)));
Q=sq((KSP2(end-3,2,:,:))); Q1a=mean(abs(Q(:))); % take image noise from the bottom of the volume, where the signal is lowest - JIC
Q=sq((KSP2(end-3,end-2,:,:))); Q1b=mean(abs(Q(:))); Q1=min(Q1a,Q1b);
Q=sq((KSP_NOISE(:,:,:,end))); Q11=mean(abs(Q(:)));
Q=sq((KSP2(end-3,2,:,:))); Q1a=mean(abs(Q(:))); % take image noise from the bottom of the volume, where the signal is lowest - JIC
Q=sq((KSP2(end-3,end-2,:,:))); Q1b=mean(abs(Q(:))); Q1=min(Q1a,Q1b);
Q=sq((KSP_NOISE(:,:,:,end))); Q11=mean(abs(Q(:)));
This should probably be mentioned in the README.
Tried on 2018a and loading nifti files could rely on MATLAB internal function, but on another computer with 2017a nifti could not be loaded.
Dear NORDIC developers,
I am trying to run NORDIC on fMRI data (BOLD and VASO). I tried a couple of protocols, and in one of them, I found the following error.
Index in position 3 is invalid. Array indices must be positive integers or logical values.
function --> subfunction_loop_for_NVR_avg_update
line 866--> KSP2_tmp=KSP2a(:,[1:w2]+(n2-1),[1:w3]+(n3-1),:);
Apparently in the second loop, w3 ==> (ARG.kernel_size(3)) change to a number that is bigger than my # slices (12 slices).
Do you know what I can do to fix that?
Best regards,
Ícaro Oliveira
Hi there,
Thank you for the work. I tried to run the NIFTI_NORDIC script with diff_MRI related magnitude and phase data, but I keep getting the sum(gfactor(:)) = 0 and therefore an incorrect estimation of the gfactor map. Could you help please?
Thank you
Hello,
I'm trying to run the DEMO as indicated in the README.md (also at the end of script_for_creating_simulation_data.m). However, when running NORDIC, I get the following error. Do you know what is happening?
Thanks very much
Cesar
NORDIC('demo_data_for_NORDIC.mat')
Using the NVR estimation method
PP =
name: 'demo_data_for_NORDIC.mat'
date: '10-Sep-2021 15:54:45'
bytes: 204721995
isdir: 0
datenum: 7.3841e+05
kernel_size =
8 8 8
CHECK if the right input to NORDIC is used
change the scaling to the recon program
ans =
0.4117 0.4020
I am master, I have control
1 Undefined function or variable 'subfunction_loop_for_NVR_avg_update'.
Error in NORDIC>sub_NVR_for_one_slice (line 535)
subfunction_loop_for_NVR_avg_update(KSP2a,ARG.kernel_size(3),ARG.kernel_size(2),ARG.kernel_size(1),lambda,1,ARG.soft_thrs,KSP2_weight_tmp,ARG,NOISE_tmp,Component_threshold_tmp,energy_removed_tmp);
Error in NORDIC>NVR_LLR_3D_MP_2 (line 253)
[KSP_recon,~,KSP_weight,NOISE,Component_threshold,energy_removed]=sub_NVR_for_one_slice(KSP_recon,KSP2,ARG,n1,QQ,master_fast,KSP_weight,NOISE,Component_threshold,energy_removed)
; % save all files
Error in NORDIC (line 23)
NVR_LLR_3D_MP_2(DIR,file_filter,file_idx,NORDIC_threshold,DUAL,kernel_size,patch_avg,['kernel_' num2str(ker)],restart_list, master_fast,soft_thrs,
patch_avg_sub);
Hello Steen,
I'm trying to run the DEMO commands as follows, but got an error with the sq function. What's the function or variable sq?
It might be possible that I am using a very old matlab version, but I could not find any function in Mathworks online help.
Thanks very much,
Cesar
script_for_creating_simulation_data
NORDIC('demo_data_for_NORDIC.mat')
QQ=load('KSP_demo_data_for_NORDICkernel8')
Q=load('demo_data_for_NORDIC')
figure; clf
subplot(2,2,1); imagesc(sq(real(Q.KSP(:,:,32,12))),[0 1]); title('Data + noise')
subplot(2,2,2); imagesc(sq(real(Q.IMG(:,:,32,12))),[0 1]); title('Data w/o noise')
subplot(2,2,3); imagesc(sq(real(QQ.KSP_update(:,:,32,12))),[0 1]); title('NORDIC processed')
subplot(2,2,4); plot(sq(real(Q.KSP(20,25,32,1:end-2) - Q.IMG(20,25,32,1:end-1)))), hold on
plot(sq(real(QQ.KSP_update(20,25,32,1:end) - Q.IMG(20,25,32,1:end-1))))
legend('difference before NORDIC','difference after NORDIC')
Undefined function 'sq' for input arguments of type 'double'.
probable typos detected using codespell
$ codespell
./NORDIC.m:7: auxilary ==> auxiliary
./NORDIC.m:7: shoudl ==> should
./NORDIC.m:7: shoudl ==> should
./NORDIC.m:17: shoudl ==> should
./NORDIC.m:19: Paramter ==> Parameter
./NORDIC.m:35: allready ==> already, all ready
./NORDIC.m:110: Usefull ==> Useful
./NORDIC.m:305: allready ==> already, all ready
./NORDIC.m:318: detrmine ==> determine
./NORDIC.m:771: MEMEORY ==> MEMORY
./README.md:16: paramters ==> parameters
./README.md:16: algortimic ==> algorithmic
./README.md:18: neccesary ==> necessary
./README.md:20: evaulation ==> evaluation
./README.md:56: neccesary ==> necessary
./NIFTI_NORDIC.m:23: specifiec ==> specific
./NIFTI_NORDIC.m:36: defautl ==> default
./NIFTI_NORDIC.m:38: temproal ==> temporal
./NIFTI_NORDIC.m:42: additonal ==> additional
./NIFTI_NORDIC.m:42: degress ==> degrees, digress
./NIFTI_NORDIC.m:49: Specifiec ==> Specific
./NIFTI_NORDIC.m:179: Serach ==> Search
./NIFTI_NORDIC.m:293: Standarad ==> Standard
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.