{"action":"created","issue":{"url":"https://api.github.com/repos/MRtrix3/mrtrix3/issues/225","labels_url":"https://api.github.com/repos/MRtrix3/mrtrix3/issues/225/labels{/name}","comments_url":"https://api.github.com/repos/MRtrix3/mrtrix3/issues/225/comments","events_url":"https://api.github.com/repos/MRtrix3/mrtrix3/issues/225/events","html_url":"https://github.com/MRtrix3/mrtrix3/pull/225","id":69963852,"number":225,"title":"Updated syntax for Image classes ","user":{"login":"jdtournier","id":3221000,"avatar_url":"https://avatars.githubusercontent.com/u/3221000?v=3","gravatar_id":"","url":"https://api.github.com/users/jdtournier","html_url":"https://github.com/jdtournier","followers_url":"https://api.github.com/users/jdtournier/followers","following_url":"https://api.github.com/users/jdtournier/following{/other_user}","gists_url":"https://api.github.com/users/jdtournier/gists{/gist_id}","starred_url":"https://api.github.com/users/jdtournier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdtournier/subscriptions","organizations_url":"https://api.github.com/users/jdtournier/orgs","repos_url":"https://api.github.com/users/jdtournier/repos","events_url":"https://api.github.com/users/jdtournier/events{/privacy}","received_events_url":"https://api.github.com/users/jdtournier/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/MRtrix3/mrtrix3/labels/critical","name":"critical","color":"e11d21"},{"url":"https://api.github.com/repos/MRtrix3/mrtrix3/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/MRtrix3/mrtrix3/labels/help%20wanted","name":"help wanted","color":"159818"}],"state":"open","locked":false,"assignee":{"login":"jdtournier","id":3221000,"avatar_url":"https://avatars.githubusercontent.com/u/3221000?v=3","gravatar_id":"","url":"https://api.github.com/users/jdtournier","html_url":"https://github.com/jdtournier","followers_url":"https://api.github.com/users/jdtournier/followers","following_url":"https://api.github.com/users/jdtournier/following{/other_user}","gists_url":"https://api.github.com/users/jdtournier/gists{/gist_id}","starred_url":"https://api.github.com/users/jdtournier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdtournier/subscriptions","organizations_url":"https://api.github.com/users/jdtournier/orgs","repos_url":"https://api.github.com/users/jdtournier/repos","events_url":"https://api.github.com/users/jdtournier/events{/privacy}","received_events_url":"https://api.github.com/users/jdtournier/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/MRtrix3/mrtrix3/milestones/1","html_url":"https://github.com/MRtrix3/mrtrix3/milestones/MRtrix3%203.0%20release%20for%20ISMRM","labels_url":"https://api.github.com/repos/MRtrix3/mrtrix3/milestones/1/labels","id":1036648,"number":1,"title":"MRtrix3 3.0 release for ISMRM","description":"I think it's time we got a proper release going - we've been in beta for a year now... It would be great to have a proper 3.0 release come ISMRM. So let's set a Milestone, and try to get things in order by then.\r\n\r\nTo get this going, we should go through the list of current issues and identify those that need to be addressed by that stage. It would also be good to identify applications that might be ready for inclusion into the MRtrix3 core by that stage - I'm thinking multi-tissue CSD, SIFT2, AFD, rcsdeconv, etc. Feel free to chip in on this issue, or better yet, create an issue and link it with this milestone...\r\n\r\nCheers,\r\nDonald.","creator":{"login":"jdtournier","id":3221000,"avatar_url":"https://avatars.githubusercontent.com/u/3221000?v=3","gravatar_id":"","url":"https://api.github.com/users/jdtournier","html_url":"https://github.com/jdtournier","followers_url":"https://api.github.com/users/jdtournier/followers","following_url":"https://api.github.com/users/jdtournier/following{/other_user}","gists_url":"https://api.github.com/users/jdtournier/gists{/gist_id}","starred_url":"https://api.github.com/users/jdtournier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdtournier/subscriptions","organizations_url":"https://api.github.com/users/jdtournier/orgs","repos_url":"https://api.github.com/users/jdtournier/repos","events_url":"https://api.github.com/users/jdtournier/events{/privacy}","received_events_url":"https://api.github.com/users/jdtournier/received_events","type":"User","site_admin":false},"open_issues":24,"closed_issues":52,"state":"open","created_at":"2015-03-24T16:09:24Z","updated_at":"2015-10-06T04:48:38Z","due_on":"2015-05-30T23:00:00Z","closed_at":null},"comments":141,"created_at":"2015-04-21T22:06:14Z","updated_at":"2015-10-06T07:39:09Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/MRtrix3/mrtrix3/pulls/225","html_url":"https://github.com/MRtrix3/mrtrix3/pull/225","diff_url":"https://github.com/MRtrix3/mrtrix3/pull/225.diff","patch_url":"https://github.com/MRtrix3/mrtrix3/pull/225.patch"},"body":"This branch introduces a new cleaner API for the Image classes, as discussed in #211 \r\n\r\nCurrently, the only command working is `bogus` - and even then it only works on some inputs. Still need to implement preloading and scratch buffer support. A long way to go yet...\r\n\r\nBut it does make things look a bit cleaner. For example, from `cmd/bogus.cpp`:\r\n\r\n```C++\r\nvoid run ()\r\n{\r\n  value_type power = 2.0;\r\n  auto opt = get_options (\"power\");\r\n  if (opt.size())\r\n    power = opt[0][0];\r\n\r\n  auto in = Header::open (argument[0]).get_image<value_type>();\r\n  auto header = in.header();\r\n  header.datatype() = DataType::Float32;\r\n  auto out = Header::create (argument[1], header).get_image<value_type>(); \r\n\r\n  ThreadedLoop (in).run ([&](decltype(in)& vin, decltype(out)& vout) {\r\n    vout.value() = std::pow (vin.value(), power);\r\n    }, in, out);\r\n}\r\n```\r\n\r\nAnyway, not ready to merge by any stretch, but thought I'd give people a sneak preview :smile: \r\n\r\nOnce it's stable, I wouldn't mind some help porting all the apps to the new framework..."},"comment":{"url":"https://api.github.com/repos/MRtrix3/mrtrix3/issues/comments/145769233","html_url":"https://github.com/MRtrix3/mrtrix3/pull/225#issuecomment-145769233","issue_url":"https://api.github.com/repos/MRtrix3/mrtrix3/issues/225","id":145769233,"user":{"login":"jdtournier","id":3221000,"avatar_url":"https://avatars.githubusercontent.com/u/3221000?v=3","gravatar_id":"","url":"https://api.github.com/users/jdtournier","html_url":"https://github.com/jdtournier","followers_url":"https://api.github.com/users/jdtournier/followers","following_url":"https://api.github.com/users/jdtournier/following{/other_user}","gists_url":"https://api.github.com/users/jdtournier/gists{/gist_id}","starred_url":"https://api.github.com/users/jdtournier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdtournier/subscriptions","organizations_url":"https://api.github.com/users/jdtournier/orgs","repos_url":"https://api.github.com/users/jdtournier/repos","events_url":"https://api.github.com/users/jdtournier/events{/privacy}","received_events_url":"https://api.github.com/users/jdtournier/received_events","type":"User","site_admin":false},"created_at":"2015-10-06T07:39:09Z","updated_at":"2015-10-06T07:39:09Z","body":"@lestropie, not sure what you mean by \"it's only 3D texture loading\" - it's precisely because we're loading potentially very large 3D textures onto the limited onboard GPU RAM that this matters. If RAM wasn't a concern, I totally agree that we might as well use floats throughout. But most systems won't have a great deal of it - remember a lot of our users will be using laptops (Macbooks in particular it seems), and even loading a large TDI would be enough to exceed its capacity. So I think it's really important that we try to minimise RAM usage as much as possible. And that means if we can load an image into a 16 bit texture without loss of information, we should. And it's not just TDI images either, a high resolution anatomical scan can happily take up ~100MB, so it only takes loading a few of those (maybe as overlays too) to overload an entry-level GPU, at which point you're dependent on the quality of your drivers as to how well it deals with swapping in & out of system RAM - assuming it doesn't bring the system to its knees in the process...\r\n\r\nBesides, the code to handle this is already in place. It's relatively easy to do since we have to rescale the data in the shader anyway to handle brightness/contrast - just need to make sure those values are properly updated. And as you say, this doesn't affect the values reported on-screen in any way, this is purely about on-GPU memory management... To port the existing backend over should only take a few extra lines of code to allow the approach I'd suggested above. \r\n\r\nBut like I said, this isn't critical for now. As long as things work the way you've got them when images aren't scaled, you can get on with fixing everything else (seems there's plenty enough to do already...). I can have a go at sorting this out in a couple of weeks - if you don't beat me to it..."}}