{"action":"created","issue":{"url":"https://api.github.com/repos/timholy/Images.jl/issues/553","repository_url":"https://api.github.com/repos/timholy/Images.jl","labels_url":"https://api.github.com/repos/timholy/Images.jl/issues/553/labels{/name}","comments_url":"https://api.github.com/repos/timholy/Images.jl/issues/553/comments","events_url":"https://api.github.com/repos/timholy/Images.jl/issues/553/events","html_url":"https://github.com/timholy/Images.jl/issues/553","id":176097419,"number":553,"title":"Best way to load sequence of images?","user":{"login":"tlnagy","id":1661487,"avatar_url":"https://avatars.githubusercontent.com/u/1661487?v=3","gravatar_id":"","url":"https://api.github.com/users/tlnagy","html_url":"https://github.com/tlnagy","followers_url":"https://api.github.com/users/tlnagy/followers","following_url":"https://api.github.com/users/tlnagy/following{/other_user}","gists_url":"https://api.github.com/users/tlnagy/gists{/gist_id}","starred_url":"https://api.github.com/users/tlnagy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tlnagy/subscriptions","organizations_url":"https://api.github.com/users/tlnagy/orgs","repos_url":"https://api.github.com/users/tlnagy/repos","events_url":"https://api.github.com/users/tlnagy/events{/privacy}","received_events_url":"https://api.github.com/users/tlnagy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2016-09-09T20:06:43Z","updated_at":"2016-09-12T11:30:16Z","closed_at":null,"body":"I'm not sure that this is the best place to ask this, but I generally take movies that are broken up along channel info and time stored as separate TIFF files in a directory (using MicroManager by the way). Currently I'm just using a bunch of looping `load` calls for everything in `readdir`. Is there a better way of handling this? I would prefer to have the time dimension and channel info in the image metadata if possible."},"comment":{"url":"https://api.github.com/repos/timholy/Images.jl/issues/comments/246320355","html_url":"https://github.com/timholy/Images.jl/issues/553#issuecomment-246320355","issue_url":"https://api.github.com/repos/timholy/Images.jl/issues/553","id":246320355,"user":{"login":"timholy","id":1525481,"avatar_url":"https://avatars.githubusercontent.com/u/1525481?v=3","gravatar_id":"","url":"https://api.github.com/users/timholy","html_url":"https://github.com/timholy","followers_url":"https://api.github.com/users/timholy/followers","following_url":"https://api.github.com/users/timholy/following{/other_user}","gists_url":"https://api.github.com/users/timholy/gists{/gist_id}","starred_url":"https://api.github.com/users/timholy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timholy/subscriptions","organizations_url":"https://api.github.com/users/timholy/orgs","repos_url":"https://api.github.com/users/timholy/repos","events_url":"https://api.github.com/users/timholy/events{/privacy}","received_events_url":"https://api.github.com/users/timholy/received_events","type":"User","site_admin":false},"created_at":"2016-09-12T11:30:16Z","updated_at":"2016-09-12T11:30:16Z","body":"Thanks.\r\n\r\nAssuming you're on a little endian machine, that `endian: big` poses an interesting challenge. Formerly, it would have obviated the use `mmap` on the input array, which would be rather unfortunate if you recorded hours of data and had a 1TB file to deal with. In the past you would have been essentially forced to copy the file to little-endian format to work with it in Julia.\r\n\r\nBut now we have [MappedArrays](https://github.com/JuliaArrays/MappedArrays.jl), and we can do on-the-fly transformation with essentially no \"extra\" overhead:\r\n```jl\r\njulia> using MappedArrays\r\n\r\njulia> a = [0x0102, 0x0304]\r\n2-element Array{UInt16,1}:\r\n 0x0102\r\n 0x0304\r\n\r\njulia> aswap = mappedarray((ntoh,hton), a)\r\n2-element MappedArrays.MappedArray{UInt16,1,Array{UInt16,1},Base.#ntoh,Base.#hton}:\r\n 0x0201\r\n 0x0403\r\n\r\njulia> aswap[1]\r\n0x0201\r\n```\r\n\r\nPerformance:\r\n```jl\r\njulia> a = rand(UInt16, 10^4);\r\n\r\njulia> aswap = mappedarray((ntoh,hton), a);\r\n\r\njulia> using BenchmarkTools\r\n\r\njulia> @benchmark sum($a)\r\nBenchmarkTools.Trial: \r\n  samples:          10000\r\n  evals/sample:     60\r\n  time tolerance:   5.00%\r\n  memory tolerance: 1.00%\r\n  memory estimate:  0.00 bytes\r\n  allocs estimate:  0\r\n  minimum time:     866.00 ns (0.00% GC)\r\n  median time:      874.00 ns (0.00% GC)\r\n  mean time:        884.48 ns (0.00% GC)\r\n  maximum time:     1.45 μs (0.00% GC)\r\n\r\njulia> @benchmark sum($aswap)\r\nBenchmarkTools.Trial: \r\n  samples:          10000\r\n  evals/sample:     10\r\n  time tolerance:   5.00%\r\n  memory tolerance: 1.00%\r\n  memory estimate:  0.00 bytes\r\n  allocs estimate:  0\r\n  minimum time:     1.17 μs (0.00% GC)\r\n  median time:      1.22 μs (0.00% GC)\r\n  mean time:        1.23 μs (0.00% GC)\r\n  maximum time:     15.93 μs (0.00% GC)\r\n```\r\nJulia is so awesome, sometimes I just have to cheer.\r\n\r\nNote that `MappedArrays` requires Julia 0.5, so to do this automatically we'll have to bump the Julia version of this package another notch. Probably best to do this in conjunction with release of the rewritten Images?"}}
{"actor":{"display_login":"timholy"}}