-
Notifications
You must be signed in to change notification settings - Fork 13
Feature #566 hadamard motion correction #689
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
Conversation
|
Ok, when inducing motion to the first volume, to clearly see if some motion correction was being done, it was not working at all. No motion correction was being applied even if the rp_file was okay. (difference between volume 0 and volume 8 - before - ASL4D.nii) (difference between volume 0 and volume 8 - after - rASL4D.nii) [this was the way I found to show the difference between vol0 and vol8, but if we open the images with fsleyes is really clear that there's no motion after the normal motion correction] @jan-petr is this enough? I have to show you |
jan-petr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good. Except the HadamardType...
jan-petr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK.
…otion correction on it
…e motion for all TE of the same PLD and return the original rp files back so the plots work
…ultiTE+singlePLD
…correction of FD{2} for multi-TE and option for multiPLD single TE in line 122
… Hadamard recognition in ASLmodule function
352fa81 to
af3d8d7
Compare
| % | ||
| % FORMAT: xASL_im_Move3DVolume(pathNifti, pathResult, dim, volNum, numVoxel) | ||
| % | ||
| % INPUT: pathNifti (CHAR ARRAY, REQUIRED) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BeatrizPadrela You need to explain a bit here what the input arguments mean, not only their format.
| % Define realignment settings | ||
| tempnii = xASL_io_ReadNifti(InputPath); | ||
| nFrames = double(tempnii.hdr.dim(5)); | ||
| if length(x.EchoTime)>1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BeatrizPadrela This could go wrong for non-multi-TE sequences. The EchoTime can also be (incorrectly) a vector in enhanced DICOM. So we need to add a boolean like if bMultiEcho
| % Run SPM | ||
| if nFrames>2 && bSubtraction | ||
|
|
||
| %####### Calculating the motion for every first TE of each PLD and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BeatrizPadrela #### is for languages like Bash, %%%% for Matlab :)
| %####### Calculating the motion for every first TE of each PLD and | ||
| % considering it the same for the other TEs from that PLD. | ||
| % | ||
| % if nFrames>2 && bSubtraction && length(x.EchoTime)>1 %Multi TE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BeatrizPadrela So this should also start with something like if bMultiEcho. Makes it less prone to error and also easier to read
| % considering it the same for the other TEs from that PLD. | ||
| % | ||
| % if nFrames>2 && bSubtraction && length(x.EchoTime)>1 %Multi TE | ||
| % uniqueTE=uniquetol(x.EchoTime); %gives the number of unique TEs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BeatrizPadrela Should we really use uniquetol here or would unique be better? We haven't specified the tolerance here...
| % uniqueTE=uniquetol(x.EchoTime); %gives the number of unique TEs | ||
| % NumTEs=numel(uniqueTE); | ||
| % minTE=min(uniqueTE); | ||
| % positionMinTE=find(x.EchoTime == minTE); %positions that have the min TE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BeatrizPadrela At some locations in this script we use TE at other locations EchoTime, though they mean the same right? Would be good to homogenize for readability.
| % if numel(unique(x.Q.Initial_PLD))==1 %multiTE + single PLD | ||
| % spm_realign(ImInfoFirstTEs,flags,true); | ||
| % MotionFirstTEs=load(rpfile); | ||
| % MotionAllTEs=repelem(MotionFirstTEs(:,:),NumTEs,1); %repeats each row NumTEs times |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BeatrizPadrela Is this also possible with repmat? Is a bit more backward compatible.
| % spm_realign(ImInfoFirstTEs,flags,false); | ||
| % MotionFirstTEs=load(rpfile); | ||
| % MotionAllTEs=repelem(MotionFirstTEs(:,:),NumTEs,1); | ||
| % save('rp_ASL4D.txt','MotionAllTEs','-ascii') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
; missing
|
|
||
| % Summarize real-world realign parameters into net displacement vector (NDV) | ||
| rp = load(rpfile, '-ascii'); % load the 3 translation and 3 rotation values | ||
| MeanRadius = 50; % typical distance center head to cerebral cortex (Power et al., NeuroImage 2012) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BeatrizPadrela Apparently, this needs adaptation in some cases. Something for the future :)


Linked issue
Check out #566