Skip to content
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

Confused about constructor #46

Open
PetrKryslUCSD opened this issue Dec 8, 2020 · 1 comment
Open

Confused about constructor #46

PetrKryslUCSD opened this issue Dec 8, 2020 · 1 comment

Comments

@PetrKryslUCSD
Copy link
Contributor

PetrKryslUCSD commented Dec 8, 2020

Why does the constructor not refer to the type of the element of raw?
The lines

NIVolume(header::NIfTI1Header, extensions::Vector{NIfTI1Extension}, raw::AbstractArray{T,N}) where {T<:Number,N} =
,
NIVolume{typeof(one(T)*1f0+1f0),N,typeof(raw)}(header, extensions, raw)

create the volume of type Float32 instead of T. Shouldn't this be

NIVolume(header::NIfTI1Header, extensions::Vector{NIfTI1Extension}, raw::AbstractArray{T,N}) where {T<:Number,N} = let
    NIVolume{T,N,typeof(raw)}(header, extensions, raw)
    # Why is this not using T? That is the type of the `raw` array elements!?
    #NIVolume{typeof(one(T)*1f0+1f0),N,typeof(raw)}(header, extensions, raw)
end

?

@PetrKryslUCSD
Copy link
Contributor Author

Okay, now I realized there was another issue about this: #31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant