-
-
Notifications
You must be signed in to change notification settings - Fork 100
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
Add polynomial function to dummy_segmentation #2684
Conversation
|
|
||
# Loop across individual volumes of 4D data | ||
for volume in range(0,vol_num): | ||
factor = uniform(0.5, 3.0) # shift in voxels |
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.
This factor could probably take into account breath frequency and repetition time in some way.
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.
it could, but i would not worry too much (as TR can also vary by several seconds)
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.
👍
z = np.arange(0, nz) | ||
p = poly1d(polyfit(z, y, deg=nz)) | ||
# loop across slices and add object | ||
for iz in range(nz): |
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.
code duplication with lines 138-142. you could create a nested function
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.
code slightly differs in second parentheses. Isn't current workaround better for clarity than nested function?
I generated some dummy 4D data with proposed
Whole 4D data looks: Slice-wise shift is noticeable mainly at beginning and end of SI axis. This corresponds with polynomial function fit visualization for one volume: So, my question is - is this fit suitable? Or should it be modified to better fit middle points/slices? I also tried to run |
awesome work @valosekj 🚀 yes, i think these simulated motions are fairly realistic (in terms of amplitude and location). In any case, this gives us a solid basis for improving the realism in the future (could be dedicated to another PR). |
This PR aims to address #2678 (creation of synthetic interleaved DWI data).
So far, I added polynomial function to
dummy_segmentation
to simulate slicewise motion:TODO:
dummy_segmentation
n-times with various factor of polynomial function and then merge individual 3D data into 4D dataset