KomaMRI.jl
KomaMRI.jl copied to clipboard
Enable the use of `Phantom{Array{T, N}, MotionModel{T}}`
Feature Request
This is related to #184. By doing this, we can dispatch based on the dimension of the phantom, Maps like obj.T1
will preserve their structure (no T1[:]
), preserve neighbor information (#52 ?), save memory (x
, y
, z
can be dropped from the definition), dispatch the plotting function if the phantom is 1D, 2D, 3D, etc.
From https://github.com/JuliaHealth/KomaMRI.jl/pull/342#discussion_r1542095792:
Possibly some more of the code could go in supporting functions or macros going forward as well. A possible variation would be a an abstract phantom parent object inheriting the dimensionality and the specific input dataset along with supporting methods?
I am not sure if I understood correctly, but right now the maps (obj.T1, obj.T2, etc..) are converted to Vector{T}'s before being stored in Phantom{T}, so we lose some information. Your suggestion would be to enable Array{T,N}s? If that is the case, that sounds good to me. It was like that at some point actually. I simplified it for simulation reasons, so the first dimension is the "spin" dimension, and the second dimension is time. Nevertheless, there are no good reasons (besides simulating fewer points ρ.==0) to pass this burden to the user, and in the cases in which we have Phantom{Array{T,N}}, that has an implicit structure, the spins' positions could be dropped.