davidssmith / DCEMRI.jl

DCE MRI analysis in Julia
Other
37 stars 16 forks source link

ERROR: MethodError: `ser` has no method matching ser(::Array{Float32,4}) in science.jl:189 #17

Closed elijahrockers closed 8 years ago

elijahrockers commented 8 years ago
julia> results = fitdata(datafile="/space/bic/subjects/tau_gadolinium/old/antinarcotic/dceMRIWorking/DCEMRI.jl/antinarcotic.mat")
running models
adding 4 workers
WARNING: `require` is deprecated, use `using` or `import` instead
 in depwarn at deprecated.jl:73
 [inlined code] from deprecated.jl:694
 in require at no file:0
 in fitdata at /home/users/elijah/.julia/v0.4/DCEMRI/src/science.jl:166
while loading no file, in expression starting on line 0
WARNING: replacing module DCEMRI
found multi-flip data
fitting R1 relaxation rate to multi-flip data
fitting 5 x 46212 points on each of 4 workers
processed 184850 voxels in 7.9 s (23420.3 vox/s)

ERROR: MethodError: `ser` has no method matching ser(::Array{Float32,4})
 in fitdata at /home/users/elijah/.julia/v0.4/DCEMRI/src/science.jl:189
elijahrockers commented 8 years ago
function ser{N}(x::Array{Float64,N}, thresh::Float64=0.01)

ser accepts Float64, data is passed as Float32

elijahrockers commented 8 years ago

Looking at the documentation for Julia, maybe some kind of parametric type is needed to accommodate both 32 and 64? idk, a wee bit over my head here

elijahrockers commented 8 years ago

Noticed DCEdata was loaded into MATLAB as a single, I typecast it as a double now.

davidssmith commented 8 years ago

Glad you found the problem. At some point the code could be adapted to work with singles by making these functions either do the typecasting internally or by widening the call signature to include all floating types, as with the abstract Real or AbstractFloat types.