diff --git a/examples/MotionCompensation/example.jl b/examples/MotionCompensation/example.jl index dea2174..e93b17b 100644 --- a/examples/MotionCompensation/example.jl +++ b/examples/MotionCompensation/example.jl @@ -61,7 +61,7 @@ c = reconstruction(bSF, bMeas, periodicMotionCorrection = true, SNRThresh=2,minFreq=80e3,recChannels=[1,2,3]) #frequency selection figure(2) -imshow( maximum(arraydata(c[1,:,:,:,1]),dims=3)[:,:,1] ) +imshow( maximum(Array(c[1,:,:,:,1]),dims=3)[:,:,1] ) @@ -79,7 +79,7 @@ cStatic = reconstructionMultiPatch(bSF, bStatic, bgCorrection=false, λ=lambda, iterations=iterations) figure(3) -imshow( maximum(arraydata(cStatic[1,:,:,:,1]),dims=3)[:,:,1] ) +imshow( maximum(Array(cStatic[1,:,:,:,1]),dims=3)[:,:,1] ) diff --git a/test/Cartesian.jl b/test/Cartesian.jl index e33f8c4..7cba362 100644 --- a/test/Cartesian.jl +++ b/test/Cartesian.jl @@ -32,14 +32,14 @@ using MPIReco setAll!(plan, :fov, calibFov(bSF)) @time c1 = reconstruct(build(plan), b) - exportImage(joinpath(imgdir, "Cartesian1.png"), arraydata(c1[1,:,:,1,1])) + exportImage(joinpath(imgdir, "Cartesian1.png"), Array(c1[1,:,:,1,1])) @test compareImg("Cartesian1.png") # SP Reco setAll!(plan, :numPeriodGrouping, numPatches) #setAll!(plan, :maxMixingOrder, 12) # see above @time c2 = reconstruct(build(plan), b) - exportImage(joinpath(imgdir, "Cartesian2.png"), arraydata(c2[1,:,:,1,1])) + exportImage(joinpath(imgdir, "Cartesian2.png"), Array(c2[1,:,:,1,1])) @test compareImg("Cartesian2.png") # from Postprocessed @@ -53,7 +53,7 @@ using MPIReco plan.parameter.pre.numPeriodAverages = 65 @time c3 = reconstruct(build(plan), b) - exportImage(joinpath(imgdir, "Cartesian3.png"), arraydata(c3[1,:,:,1,1])) + exportImage(joinpath(imgdir, "Cartesian3.png"), Array(c3[1,:,:,1,1])) @test compareImg("Cartesian3.png") #### Low Level #### @@ -105,7 +105,7 @@ using MPIReco setAll!(plan, :numPeriodAverages, numPeriodAverages) @time c6 = reconstruct(build(plan), b) - exportImage(joinpath(imgdir, "Cartesian6.png"), arraydata(c6[1,:,:,1,1])) + exportImage(joinpath(imgdir, "Cartesian6.png"), Array(c6[1,:,:,1,1])) @test compareImg("Cartesian6.png") end diff --git a/test/MotionCompensation.jl b/test/MotionCompensation.jl index 5df9185..f339fe1 100644 --- a/test/MotionCompensation.jl +++ b/test/MotionCompensation.jl @@ -51,12 +51,12 @@ using MPIReco setAll!(plan, :λ, 0.0f0) c = reconstruct(build(plan), bMeas) - exportImage(joinpath(imgdir, "Motion1.png"), maximum(arraydata(c[1,:,:,:,1]),dims=3)[:,:,1]) + exportImage(joinpath(imgdir, "Motion1.png"), maximum(Array(c[1,:,:,:,1]),dims=3)[:,:,1]) @test compareImg("Motion1.png") setAll!(plan, :bgParams, SimpleExternalBackgroundCorrectionParameters(;emptyMeas = bBG, bgFrames = bgFrames)) c = reconstruct(build(plan), bMeas) - exportImage(joinpath(imgdir, "Motion2.png"), maximum(arraydata(c[1,:,:,:,1]),dims=3)[:,:,1]) + exportImage(joinpath(imgdir, "Motion2.png"), maximum(Array(c[1,:,:,:,1]),dims=3)[:,:,1]) @test compareImg("Motion2.png") end diff --git a/test/MultiPatch.jl b/test/MultiPatch.jl index 814508c..164db8c 100644 --- a/test/MultiPatch.jl +++ b/test/MultiPatch.jl @@ -27,7 +27,7 @@ using MPIReco c1 = reconstruct(build(plan), b) @test axisnames(c1) == names @test axisvalues(c1) == values1 - exportImage(joinpath(imgdir, "MultiPatch1.png"), arraydata(c1[1,:,:,1,1])) + exportImage(joinpath(imgdir, "MultiPatch1.png"), Array(c1[1,:,:,1,1])) @test compareImg("MultiPatch1.png") # TODO test description @@ -36,7 +36,7 @@ using MPIReco setAll!(plan, :roundPatches, false) @test axisnames(c2) == names @test axisvalues(c2) == values1 - exportImage(joinpath(imgdir, "MultiPatch2.png"), arraydata(c2[1,:,:,1,1])) + exportImage(joinpath(imgdir, "MultiPatch2.png"), Array(c2[1,:,:,1,1])) @test compareImg("MultiPatch2.png") # multi-patch reconstruction using multiple system matrices @@ -46,7 +46,7 @@ using MPIReco c3 = reconstruct(build(plan), b) @test axisnames(c3) == names @test axisvalues(c3) == values2 - exportImage(joinpath(imgdir, "MultiPatch3.png"), arraydata(c3[1,:,:,1,1])) + exportImage(joinpath(imgdir, "MultiPatch3.png"), Array(c3[1,:,:,1,1])) @test compareImg("MultiPatch3.png") # flexible multi-patch reconstruction @@ -69,7 +69,7 @@ using MPIReco c4 = reconstruct(build(plan), b) @test axisnames(c4) == names @test axisvalues(c4) == values2 - exportImage(joinpath(imgdir, "MultiPatch4.png"), arraydata(c4[1,:,:,1,1])) + exportImage(joinpath(imgdir, "MultiPatch4.png"), Array(c4[1,:,:,1,1])) @test compareImg("MultiPatch4.png") # TODO the last test shows odd results diff --git a/test/Reconstruction.jl b/test/Reconstruction.jl index 461f59d..69dbdbd 100644 --- a/test/Reconstruction.jl +++ b/test/Reconstruction.jl @@ -26,7 +26,7 @@ using MPIReco c1 = reconstruct(build(plan), b) @test axisnames(c1) == names @test axisvalues(c1) == values - exportImage(joinpath(imgdir, "Reconstruction1.png"), arraydata(c1[1,:,:,1,1])) + exportImage(joinpath(imgdir, "Reconstruction1.png"), Array(c1[1,:,:,1,1])) @test compareImg("Reconstruction1.png") # fused lasso @@ -43,7 +43,7 @@ using MPIReco #setAll!(plan, :normalizeReg, SystemMatrixBasedNormalization()) #@test axisnames(c2) == names #@test axisvalues(c2) == values - #exportImage(joinpath(imgdir, "Reconstruction2.png"), arraydata(c2[1,:,:,1,1])) + #exportImage(joinpath(imgdir, "Reconstruction2.png"), Array(c2[1,:,:,1,1])) #@test compareImg("Reconstruction2.png") # with interpolation @@ -51,7 +51,7 @@ using MPIReco c3 = reconstruct(build(plan), b) @test axisnames(c3) == names @test axisvalues(c3) == (values[1], -27.8u"mm":0.4u"mm":11.8u"mm", -11.8u"mm":0.4u"mm":27.8u"mm", values[4:5]...) - exportImage(joinpath(imgdir, "Reconstruction3.png"), arraydata(c3[1,:,:,1,1])) + exportImage(joinpath(imgdir, "Reconstruction3.png"), Array(c3[1,:,:,1,1])) @test compareImg("Reconstruction3.png") # with fov adpation and center shift @@ -60,7 +60,7 @@ using MPIReco @test axisnames(c4) == names # TODO Tobi: does this make sense? @test axisvalues(c4) == (values[1], -27.6u"mm":0.8u"mm":11.6u"mm", -11.6u"mm":0.8u"mm":27.6u"mm", 499.5u"mm":1000.0u"mm":499.5u"mm", values[5]) - exportImage(joinpath(imgdir, "Reconstruction4.png"), arraydata(c4[1,:,:,1,1])) + exportImage(joinpath(imgdir, "Reconstruction4.png"), Array(c4[1,:,:,1,1])) @test compareImg("Reconstruction4.png") setAll!(plan, :gridding, SystemMatrixGriddingParameter(;gridsize=calibSize(bSF), fov = calibFov(bSF))) @@ -70,9 +70,9 @@ using MPIReco c5 = reconstruct(build(plan), b) @test axisnames(c5) == names @test axisvalues(c5) == (1:2,values[2:end]...) - exportImage(joinpath(imgdir, "Reconstruction5a.png"), arraydata(c5[1,:,:,1,1])) + exportImage(joinpath(imgdir, "Reconstruction5a.png"), Array(c5[1,:,:,1,1])) @test compareImg("Reconstruction5a.png") - exportImage(joinpath(imgdir, "Reconstruction5b.png"), arraydata(c5[2,:,:,1,1])) + exportImage(joinpath(imgdir, "Reconstruction5b.png"), Array(c5[2,:,:,1,1])) @test compareImg("Reconstruction5b.png") #= # dict based reco @@ -87,7 +87,7 @@ using MPIReco c6 = reconstruction(r) @test axisnames(c6) == names @test axisvalues(c6) == values - exportImage(joinpath(imgdir, "Reconstruction6.png"), arraydata(c6[1,:,:,1,1])) + exportImage(joinpath(imgdir, "Reconstruction6.png"), Array(c6[1,:,:,1,1])) @test compareImg("Reconstruction6.png") =# @@ -97,17 +97,17 @@ using MPIReco # channel weighting setAll!(plan, :weightingParams, ChannelWeightingParameters(channelWeights = [1.0, 1.0, 1.0])) c7a = reconstruct(build(plan), b) - exportImage(joinpath(imgdir, "Reconstruction7a.png"), arraydata(c7a[1,:,:,1,1])) + exportImage(joinpath(imgdir, "Reconstruction7a.png"), Array(c7a[1,:,:,1,1])) @test compareImg("Reconstruction7a.png") setAll!(plan, :weightingParams, ChannelWeightingParameters(channelWeights = [1.0,0.001,1.0])) c7b = reconstruct(build(plan), b) - exportImage(joinpath(imgdir, "Reconstruction7b.png"), arraydata(c7b[1,:,:,1,1])) + exportImage(joinpath(imgdir, "Reconstruction7b.png"), Array(c7b[1,:,:,1,1])) @test compareImg("Reconstruction7b.png") setAll!(plan, :weightingParams, ChannelWeightingParameters(channelWeights = [0.001,1.0,1.0])) c7c = reconstruct(build(plan), b) - exportImage(joinpath(imgdir, "Reconstruction7c.png"), arraydata(c7c[1,:,:,1,1])) + exportImage(joinpath(imgdir, "Reconstruction7c.png"), Array(c7c[1,:,:,1,1])) @test compareImg("Reconstruction7c.png") end diff --git a/test/SMExtrapolation.jl b/test/SMExtrapolation.jl index b7dca52..ae35717 100644 --- a/test/SMExtrapolation.jl +++ b/test/SMExtrapolation.jl @@ -35,14 +35,14 @@ using MPIReco setAll!(plan, :fov, calibFov(bSF).+[0.006,0.006,0]) c_extr = reconstruct(build(plan), b) @test size(c1[1,:,:,:,1]) .+ (4,4,0) == size(c_extr[1,:,:,:,1]) - exportImage(joinpath(imgdir, "Extrapolated1.png"), arraydata(c_extr[1,:,:,1,1])) + exportImage(joinpath(imgdir, "Extrapolated1.png"), Array(c_extr[1,:,:,1,1])) @test compareImg("Extrapolated1.png") setAll!(plan, :gridsize, calibSize(bSF)) setAll!(plan, :fov, calibFov(bSF).+[0.006,0.006,0]) c_extr2 = reconstruct(build(plan), b) @test size(c1[1,:,:,:,1]) == size(c_extr2[1,:,:,:,1]) - exportImage(joinpath(imgdir, "Extrapolated2.png"), arraydata(c_extr2[1,:,:,1,1])) + exportImage(joinpath(imgdir, "Extrapolated2.png"), Array(c_extr2[1,:,:,1,1])) @test compareImg("Extrapolated2.png") SFdirs = ["8.mdf", "9.mdf", "10.mdf", "11.mdf"] @@ -72,7 +72,7 @@ using MPIReco setAll!(plan, :mapping, 1:4) c_extr3 = reconstruct(build(plan), b) @test size(c2[1,:,:,:,1]) .+ (6,6,0) == size(c_extr3[1,:,:,:,1]) - exportImage(joinpath(imgdir, "ExtrapolatedMultiPatch1.png"), arraydata(c_extr3[1,:,:,1,1])) + exportImage(joinpath(imgdir, "ExtrapolatedMultiPatch1.png"), Array(c_extr3[1,:,:,1,1])) @test compareImg("ExtrapolatedMultiPatch1.png") SM[vec([495:505;527:537]),:] .= 0.0 + 0.0im diff --git a/test/Sparse.jl b/test/Sparse.jl index 1ed2bfa..1e985e9 100644 --- a/test/Sparse.jl +++ b/test/Sparse.jl @@ -31,7 +31,7 @@ using MPIReco c1 = reconstruct(build(plan), b) @test axisnames(c1) == names @test axisvalues(c1) == values - exportImage(joinpath(imgdir, "Sparse1.png"), arraydata(c1[1,:,:,1,1])) + exportImage(joinpath(imgdir, "Sparse1.png"), Array(c1[1,:,:,1,1])) @test compareImg("Sparse1.png") plan = getPlan("Sparse") @@ -53,7 +53,7 @@ using MPIReco c2 = reconstruct(build(plan), b) @test axisnames(c2) == names @test axisvalues(c2) == values - exportImage(joinpath(imgdir, "Sparse2.png"), arraydata(c2[1,:,:,1,1])) + exportImage(joinpath(imgdir, "Sparse2.png"), Array(c2[1,:,:,1,1])) @test compareImg("Sparse2.png") setAll!(plan, :sparseTrafo, "FFT") @@ -61,7 +61,7 @@ using MPIReco c3 = reconstruct(build(plan), b) @test axisnames(c3) == names @test axisvalues(c3) == valuesDF - exportImage(joinpath(imgdir, "Sparse3.png"), arraydata(c3[1,:,:,1,1])) + exportImage(joinpath(imgdir, "Sparse3.png"), Array(c3[1,:,:,1,1])) @test compareImg("Sparse3.png") setAll!(plan, :SNRThresh, 3) @@ -72,7 +72,7 @@ using MPIReco c4 = reconstruct(build(plan), b) @test axisnames(c4) == names @test axisvalues(c4) == values - exportImage(joinpath(imgdir, "Sparse4.png"), arraydata(c4[1,:,:,1,1])) + exportImage(joinpath(imgdir, "Sparse4.png"), Array(c4[1,:,:,1,1])) @test compareImg("Sparse4.png") setAll!(plan, :spectralLeakageCorrection, true) @@ -82,7 +82,7 @@ using MPIReco setAll!(plan, :spectralLeakageCorrection, false) @test axisnames(c5) == names @test axisvalues(c5) == valuesDF - exportImage(joinpath(imgdir, "Sparse5.png"), arraydata(c5[1,:,:,1,1])) + exportImage(joinpath(imgdir, "Sparse5.png"), Array(c5[1,:,:,1,1])) @test compareImg("Sparse5.png") setAll!(plan, :sparseTrafo, "DST") @@ -90,7 +90,7 @@ using MPIReco c6 = reconstruct(build(plan), b) @test axisnames(c6) == names @test axisvalues(c6) == values - exportImage(joinpath(imgdir, "Sparse6.png"), arraydata(c6[1,:,:,1,1])) + exportImage(joinpath(imgdir, "Sparse6.png"), Array(c6[1,:,:,1,1])) @test compareImg("Sparse6.png") setAll!(plan, :spectralLeakageCorrection, true) @@ -99,6 +99,6 @@ using MPIReco c7 = reconstruct(build(plan), b) @test axisnames(c7) == names @test axisvalues(c7) == valuesDF - exportImage(joinpath(imgdir, "Sparse7.png"), arraydata(c7[1,:,:,1,1])) + exportImage(joinpath(imgdir, "Sparse7.png"), Array(c7[1,:,:,1,1])) @test compareImg("Sparse7.png") end