From markiewicz at stanford.edu Mon Apr 1 15:52:44 2019 From: markiewicz at stanford.edu (Christopher Markiewicz) Date: Mon, 1 Apr 2019 19:52:44 +0000 Subject: [Neuroimaging] ANN: nibabel 2.4.0 Message-ID: Hi all, nibabel 2.4.0 has been released. The main new thing in this release is the new Axis interface for manipulating CIFTI-2 headers by Michiel Cottaar, but including the last few patch releases in the 2.3.x series, we've seen some pretty significant improvements since 2.3.0. We've also had several first-time contributors, which is great to see. I guess this is my first release as official nibabel maintainer, so to make a couple announcements: We're going to try to move to a minor version every three months and a major version every year. 2.5.0 is scheduled for late June/early July, and 3.0 is scheduled for late September/early October, and will have a 1-month release candidate window. A number of features are scheduled for deprecation, so we'll work to make that as smooth as possible. Patch releases will come as needed, probably every 1-1.5 months, depending on activity and urgency. Additionally, 2.5.x will be the last series to support Python 2, and we'll make a good faith effort to support that series with bug fixes through the end of 2020, but with the overall deprecation plans of the wider Python community, this can only extend so far. We'll work with the OS packagers to try to keep Python 3-only packages from trying to install into Python 2 environments. Finally, our documentation could use some attention in the coming months. There are some broken links in the API docs that would be good to connect up, but more importantly, we have a number of new formats and APIs with little instruction on how to take advantage of all their features. Satra has proposed nipype-style tutorials (https://miykael.github.io/nipype_tutorial/) for creating and manipulating the various image types, which seems like a great idea. I suspect many of us have written presentations or Jupyter notebooks that introduce manipulating neuroimaging data with nibabel, which would make a good jumping-off point if we could start aggregating those. Thanks to everybody for their bug reports, pull requests, features and feedback. And a second thanks to everyone who makes time for reviews. Full changelog follows. ---- 2.4.0 (Monday 1 April 2019) ============================ New features ------------ * Alternative ``Axis``-based interface for manipulating CIFTI-2 headers (pr/641) (Michiel Cottaar, reviewed by Demien Wasserman, CM, SG) Enhancements ------------ * Accept TCK files produced by tools with other delimiter/EOF defaults (pr/720) (Soichi Hayashi, reviewed by CM, MB, MC) * Allow BrainModels or Parcels to contain a single vertex in CIFTI (pr/739) (Michiel Cottaar, reviewed by CM) * Support for ``NIFTI_XFORM_TEMPLATE_OTHER`` xform code (pr/743) (CM) Bug fixes --------- * Skip refcheck in ArraySequence construction/extension (pr/719) (Ariel Rokem, reviewed by CM, MC) * Use safe resizing for ArraySequence extension (pr/724) (CM, reviewed by MC) * Fix typo in error message (pr/726) (Jon Haitz Legarreta Gorro?o, reviewed by CM) * Support DICOM slice sorting in Python 3 (pr/728) (Samir Reddigari, reviewed by CM) * Correctly reorient dim_info when reorienting NIfTI images (Konstantinos Raktivan, CM, reviewed by CM) Maintenance ----------- * Import updates to reduce upstream deprecation warnings (pr/711, pr/705, pr/738) (EL, YOH, reviewed by CM) * Delay import of ``nibabel.testing``, ``nose`` and ``mock`` to speed up import (pr/699) (CM) * Increase coverage testing, drop coveralls (pr/722, pr/732) (CM) * Add Zenodo metadata, sorted by commits (pr/732) (CM + others) * Update author listing and copyrights (pr/742) (MB, reviewed by CM) -- Chris Markiewicz Center for Reproducible Neuroscience Stanford University -------------- next part -------------- An HTML attachment was scrubbed... URL: From bertrand.thirion at inria.fr Mon Apr 1 16:01:02 2019 From: bertrand.thirion at inria.fr (bthirion) Date: Mon, 1 Apr 2019 22:01:02 +0200 Subject: [Neuroimaging] ANN: nibabel 2.4.0 In-Reply-To: References: Message-ID: Congratulations for the release, and thx to all contributors ! Best, Bertrand On 01/04/2019 21:52, Christopher Markiewicz wrote: > Hi all, > > nibabel 2.4.0 has been released. The main new thing in this release is > the new Axis interface for manipulating CIFTI-2 headers by Michiel > Cottaar, but including the last few patch releases in the 2.3.x > series, we've seen some pretty significant improvements since 2.3.0. > We've also had several first-time contributors, which is great to see. > > I guess this is my first release as official nibabel maintainer, so to > make a couple announcements: We're going to try to move to a minor > version every three months and a major version every year. 2.5.0 is > scheduled for late June/early July, and 3.0 is scheduled for late > September/early October, and will have a 1-month release candidate > window. A number of features are scheduled for deprecation, so we'll > work to make that as smooth as possible. Patch releases will come as > needed, probably every 1-1.5 months, depending on activity and urgency. > > Additionally, 2.5.x will be the last series to support Python 2, and > we'll make a good faith effort to support that series with bug fixes > through the end of 2020, but with the overall deprecation plans of the > wider Python community, this can only extend so far. We'll work with > the OS packagers to try to keep Python 3-only packages from trying to > install into Python 2 environments. > > Finally, our documentation could use some attention in the coming > months. There are some broken links in the API docs that would be good > to connect up, but more importantly, we have a number of new formats > and APIs with little instruction on how to take advantage of all their > features. Satra has proposed nipype-style tutorials > (https://miykael.github.io/nipype_tutorial/) for creating and > manipulating the various image types, which seems like a great idea. I > suspect many of us have written presentations or Jupyter notebooks > that introduce manipulating neuroimaging data with nibabel, which > would make a good jumping-off point if we could start aggregating those. > > Thanks to everybody for their bug reports, pull requests, features and > feedback. And a second thanks to everyone who makes time for reviews. > > Full changelog follows. > > ---- > > 2.4.0 (Monday 1 April 2019) > ============================ > > New features > ------------ > * Alternative ``Axis``-based interface for manipulating CIFTI-2 headers > ? (pr/641) (Michiel Cottaar, reviewed by Demien Wasserman, CM, SG) > > Enhancements > ------------ > * Accept TCK files produced by tools with other delimiter/EOF defaults > ? (pr/720) (Soichi Hayashi, reviewed by CM, MB, MC) > * Allow BrainModels or Parcels to contain a single vertex in CIFTI > ? (pr/739) (Michiel Cottaar, reviewed by CM) > * Support for ``NIFTI_XFORM_TEMPLATE_OTHER`` xform code (pr/743) (CM) > > Bug fixes > --------- > * Skip refcheck in ArraySequence construction/extension (pr/719) (Ariel > ? Rokem, reviewed by CM, MC) > * Use safe resizing for ArraySequence extension (pr/724) (CM, reviewed > ? by MC) > * Fix typo in error message (pr/726) (Jon Haitz Legarreta Gorro?o, > ? reviewed by CM) > * Support DICOM slice sorting in Python 3 (pr/728) (Samir Reddigari, > ? reviewed by CM) > * Correctly reorient dim_info when reorienting NIfTI images > ? (Konstantinos Raktivan, CM, reviewed by CM) > > Maintenance > ----------- > * Import updates to reduce upstream deprecation warnings (pr/711, > ? pr/705, pr/738) (EL, YOH, reviewed by CM) > * Delay import of ``nibabel.testing``, ``nose`` and ``mock`` to speed up > ? import (pr/699) (CM) > * Increase coverage testing, drop coveralls (pr/722, pr/732) (CM) > * Add Zenodo metadata, sorted by commits (pr/732) (CM + others) > * Update author listing and copyrights (pr/742) (MB, reviewed by CM) > > -- > > Chris Markiewicz > > Center for Reproducible Neuroscience > > Stanford University > > > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthew.brett at gmail.com Mon Apr 1 16:29:33 2019 From: matthew.brett at gmail.com (Matthew Brett) Date: Mon, 1 Apr 2019 21:29:33 +0100 Subject: [Neuroimaging] ANN: nibabel 2.4.0 In-Reply-To: References: Message-ID: Hi Chris, Thanks much for the release, it's such a pleasure to see the project in good hands. Cheers, Matthew On Mon, Apr 1, 2019 at 8:53 PM Christopher Markiewicz wrote: > > Hi all, > > nibabel 2.4.0 has been released. The main new thing in this release is the new Axis interface for manipulating CIFTI-2 headers by Michiel Cottaar, but including the last few patch releases in the 2.3.x series, we've seen some pretty significant improvements since 2.3.0. We've also had several first-time contributors, which is great to see. > > I guess this is my first release as official nibabel maintainer, so to make a couple announcements: We're going to try to move to a minor version every three months and a major version every year. 2.5.0 is scheduled for late June/early July, and 3.0 is scheduled for late September/early October, and will have a 1-month release candidate window. A number of features are scheduled for deprecation, so we'll work to make that as smooth as possible. Patch releases will come as needed, probably every 1-1.5 months, depending on activity and urgency. > > Additionally, 2.5.x will be the last series to support Python 2, and we'll make a good faith effort to support that series with bug fixes through the end of 2020, but with the overall deprecation plans of the wider Python community, this can only extend so far. We'll work with the OS packagers to try to keep Python 3-only packages from trying to install into Python 2 environments. > > Finally, our documentation could use some attention in the coming months. There are some broken links in the API docs that would be good to connect up, but more importantly, we have a number of new formats and APIs with little instruction on how to take advantage of all their features. Satra has proposed nipype-style tutorials (https://miykael.github.io/nipype_tutorial/) for creating and manipulating the various image types, which seems like a great idea. I suspect many of us have written presentations or Jupyter notebooks that introduce manipulating neuroimaging data with nibabel, which would make a good jumping-off point if we could start aggregating those. > > Thanks to everybody for their bug reports, pull requests, features and feedback. And a second thanks to everyone who makes time for reviews. > > Full changelog follows. > > ---- > > 2.4.0 (Monday 1 April 2019) > ============================ > > New features > ------------ > * Alternative ``Axis``-based interface for manipulating CIFTI-2 headers > (pr/641) (Michiel Cottaar, reviewed by Demien Wasserman, CM, SG) > > Enhancements > ------------ > * Accept TCK files produced by tools with other delimiter/EOF defaults > (pr/720) (Soichi Hayashi, reviewed by CM, MB, MC) > * Allow BrainModels or Parcels to contain a single vertex in CIFTI > (pr/739) (Michiel Cottaar, reviewed by CM) > * Support for ``NIFTI_XFORM_TEMPLATE_OTHER`` xform code (pr/743) (CM) > > Bug fixes > --------- > * Skip refcheck in ArraySequence construction/extension (pr/719) (Ariel > Rokem, reviewed by CM, MC) > * Use safe resizing for ArraySequence extension (pr/724) (CM, reviewed > by MC) > * Fix typo in error message (pr/726) (Jon Haitz Legarreta Gorro?o, > reviewed by CM) > * Support DICOM slice sorting in Python 3 (pr/728) (Samir Reddigari, > reviewed by CM) > * Correctly reorient dim_info when reorienting NIfTI images > (Konstantinos Raktivan, CM, reviewed by CM) > > Maintenance > ----------- > * Import updates to reduce upstream deprecation warnings (pr/711, > pr/705, pr/738) (EL, YOH, reviewed by CM) > * Delay import of ``nibabel.testing``, ``nose`` and ``mock`` to speed up > import (pr/699) (CM) > * Increase coverage testing, drop coveralls (pr/722, pr/732) (CM) > * Add Zenodo metadata, sorted by commits (pr/732) (CM + others) > * Update author listing and copyrights (pr/742) (MB, reviewed by CM) > > -- > > Chris Markiewicz > > Center for Reproducible Neuroscience > > Stanford University > > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging From sebastiano.ferraris at gmail.com Sat Apr 6 12:23:04 2019 From: sebastiano.ferraris at gmail.com (Sebastiano Ferraris) Date: Sat, 6 Apr 2019 17:23:04 +0100 Subject: [Neuroimaging] NiLabels to Nipy? Message-ID: Esteemed members of the neuroimaging in python community, During my last years of PhD I had made extensive use of the nipy libraries, and I would like to thank your your time and efforts in this epic endeavour. During the studies I also open sourced a project called NiLabels (strongly based and influenced on Nibabel). It consists of a toolbox based on a Facade design pattern, aimed at quickly manipulate and measure image segmentations in various ways. Here is the repo: https://github.com/SebastianoF/nilabels and a complete list of the features can be found here: https://github.com/SebastianoF/nilabels/wiki/What-you-can-do-with-nilabels There is room for improvements and for adding new features in future versions. Nonetheless, if you think it can be in the right place, I would like it to be part of the nipy ecosystem. I already proposed the idea to Matthew Brett, and if you agree he would help me with the transition under the nipy group. Many thanks! Sebastiano -------------- next part -------------- An HTML attachment was scrubbed... URL: From satra at mit.edu Sat Apr 6 12:55:09 2019 From: satra at mit.edu (Satrajit Ghosh) Date: Sat, 6 Apr 2019 12:55:09 -0400 Subject: [Neuroimaging] NiLabels to Nipy? In-Reply-To: References: Message-ID: Hi Sebastiano, Thank you for building this library. I would say go for it. cheers, satra On Sat, Apr 6, 2019 at 12:42 PM Sebastiano Ferraris < sebastiano.ferraris at gmail.com> wrote: > Esteemed members of the neuroimaging in python community, > > During my last years of PhD I had made extensive use of the nipy > libraries, and I would like to thank your your time and efforts in this > epic endeavour. > > During the studies I also open sourced a project called NiLabels (strongly > based and influenced on Nibabel). > It consists of a toolbox based on a Facade design pattern, aimed at > quickly manipulate and measure image segmentations in various ways. > > Here is the repo: > https://github.com/SebastianoF/nilabels > > and a complete list of the features can be found here: > https://github.com/SebastianoF/nilabels/wiki/What-you-can-do-with-nilabels > > There is room for improvements and for adding new features in future > versions. > Nonetheless, if you think it can be in the right place, I would like it to > be part of the nipy ecosystem. > > I already proposed the idea to Matthew Brett, and if you agree he would > help me with the transition under the nipy group. > > Many thanks! > Sebastiano > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging > -------------- next part -------------- An HTML attachment was scrubbed... URL: From markiewicz at stanford.edu Sat Apr 6 12:50:24 2019 From: markiewicz at stanford.edu (Christopher Markiewicz) Date: Sat, 6 Apr 2019 16:50:24 +0000 Subject: [Neuroimaging] NiLabels to Nipy? In-Reply-To: References: Message-ID: Hi Sebastiano, That sounds like a great contribution to the ecosystem! Best, Chris -------- Original message -------- From: Sebastiano Ferraris Date: 4/6/19 12:41 (GMT-05:00) To: neuroimaging at python.org Cc: dzhoshkun.shakir at kcl.ac.uk Subject: [Neuroimaging] NiLabels to Nipy? Esteemed members of the neuroimaging in python community, During my last years of PhD I had made extensive use of the nipy libraries, and I would like to thank your your time and efforts in this epic endeavour. During the studies I also open sourced a project called NiLabels (strongly based and influenced on Nibabel). It consists of a toolbox based on a Facade design pattern, aimed at quickly manipulate and measure image segmentations in various ways. Here is the repo: https://github.com/SebastianoF/nilabels and a complete list of the features can be found here: https://github.com/SebastianoF/nilabels/wiki/What-you-can-do-with-nilabels There is room for improvements and for adding new features in future versions. Nonetheless, if you think it can be in the right place, I would like it to be part of the nipy ecosystem. I already proposed the idea to Matthew Brett, and if you agree he would help me with the transition under the nipy group. Many thanks! Sebastiano -------------- next part -------------- An HTML attachment was scrubbed... URL: From jbpoline at gmail.com Sat Apr 6 18:39:23 2019 From: jbpoline at gmail.com (JB Poline) Date: Sat, 6 Apr 2019 18:39:23 -0400 Subject: [Neuroimaging] NiLabels to Nipy? In-Reply-To: References: Message-ID: yes, it would be nice to see this in the ecosystem cheers JB On Sat, Apr 6, 2019 at 2:11 PM Christopher Markiewicz < markiewicz at stanford.edu> wrote: > Hi Sebastiano, > > That sounds like a great contribution to the ecosystem! > > Best, > Chris > > > -------- Original message -------- > From: Sebastiano Ferraris > Date: 4/6/19 12:41 (GMT-05:00) > To: neuroimaging at python.org > Cc: dzhoshkun.shakir at kcl.ac.uk > Subject: [Neuroimaging] NiLabels to Nipy? > > Esteemed members of the neuroimaging in python community, > > During my last years of PhD I had made extensive use of the nipy > libraries, and I would like to thank your your time and efforts in this > epic endeavour. > > During the studies I also open sourced a project called NiLabels (strongly > based and influenced on Nibabel). > It consists of a toolbox based on a Facade design pattern, aimed at > quickly manipulate and measure image segmentations in various ways. > > Here is the repo: > https://github.com/SebastianoF/nilabels > > and a complete list of the features can be found here: > https://github.com/SebastianoF/nilabels/wiki/What-you-can-do-with-nilabels > > There is room for improvements and for adding new features in future > versions. > Nonetheless, if you think it can be in the right place, I would like it to > be part of the nipy ecosystem. > > I already proposed the idea to Matthew Brett, and if you agree he would > help me with the transition under the nipy group. > > Many thanks! > Sebastiano > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging > -------------- next part -------------- An HTML attachment was scrubbed... URL: From frakkopesto at gmail.com Sat Apr 6 21:15:43 2019 From: frakkopesto at gmail.com (Franco Pestilli) Date: Sat, 6 Apr 2019 18:15:43 -0700 Subject: [Neuroimaging] [Postdoc] [job] Message-ID: <91E8EE8C-E54D-41CF-9BF2-4772D9C14A79@gmail.com> Franco Pestilli, PhD Psychology , Neuroscience and Cognitive Science Engineering , Computer Science , and Optometry by courtesy ? Indiana University, Bloomington , IN 47405 franpest at indiana.edu | brainlife.io/plab Phone: +1 (812) 856 9967 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: PostdocImagingGenomicsIUSM.pdf Type: application/pdf Size: 197216 bytes Desc: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthew.brett at gmail.com Mon Apr 8 07:56:45 2019 From: matthew.brett at gmail.com (Matthew Brett) Date: Mon, 8 Apr 2019 12:56:45 +0100 Subject: [Neuroimaging] Github team migration Message-ID: Hi, I've taken the liberty of applying the suggested migration of Github teams from legacy model to current model: https://help.github.com/en/articles/migrating-your-previous-admin-teams-to-the-improved-organization-permissions I think this won't cause any important problem, but it does change the default permission to create repositories in the Nipy organization, for members of the project teams. If you find you have lost that permission, and you want it back - please email me, or the list, I'll restore it. Cheers, Matthew From arokem at gmail.com Tue Apr 9 17:25:05 2019 From: arokem at gmail.com (Ariel Rokem) Date: Tue, 9 Apr 2019 14:25:05 -0700 Subject: [Neuroimaging] NiLabels to Nipy? In-Reply-To: References: Message-ID: Looks great! Please don't forget to also add it here: https://github.com/nipy/nipy.github.com/tree/master/_packages Thanks! On Sat, Apr 6, 2019 at 3:39 PM JB Poline wrote: > yes, it would be nice to see this in the ecosystem > cheers > JB > > On Sat, Apr 6, 2019 at 2:11 PM Christopher Markiewicz < > markiewicz at stanford.edu> wrote: > >> Hi Sebastiano, >> >> That sounds like a great contribution to the ecosystem! >> >> Best, >> Chris >> >> >> -------- Original message -------- >> From: Sebastiano Ferraris >> Date: 4/6/19 12:41 (GMT-05:00) >> To: neuroimaging at python.org >> Cc: dzhoshkun.shakir at kcl.ac.uk >> Subject: [Neuroimaging] NiLabels to Nipy? >> >> Esteemed members of the neuroimaging in python community, >> >> During my last years of PhD I had made extensive use of the nipy >> libraries, and I would like to thank your your time and efforts in this >> epic endeavour. >> >> During the studies I also open sourced a project called NiLabels >> (strongly based and influenced on Nibabel). >> It consists of a toolbox based on a Facade design pattern, aimed at >> quickly manipulate and measure image segmentations in various ways. >> >> Here is the repo: >> https://github.com/SebastianoF/nilabels >> >> and a complete list of the features can be found here: >> https://github.com/SebastianoF/nilabels/wiki/What-you-can-do-with-nilabels >> >> There is room for improvements and for adding new features in future >> versions. >> Nonetheless, if you think it can be in the right place, I would like it >> to be part of the nipy ecosystem. >> >> I already proposed the idea to Matthew Brett, and if you agree he would >> help me with the transition under the nipy group. >> >> Many thanks! >> Sebastiano >> _______________________________________________ >> Neuroimaging mailing list >> Neuroimaging at python.org >> https://mail.python.org/mailman/listinfo/neuroimaging >> > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cper2 at cam.ac.uk Fri Apr 12 12:08:36 2019 From: cper2 at cam.ac.uk (C.P.E. Rollins) Date: Fri, 12 Apr 2019 17:08:36 +0100 Subject: [Neuroimaging] Pysurfer Message-ID: <6ba2ab8ef35950b406ed0a0882441b8b@cam.ac.uk> Dear Pysurfer Developers, I'm writing to ask whether it is possible to change the line width in either the add_label or add_annotation functions. I've plotted the HCPMMP1.0 parcellation, but would like the borders of the parcellation to be thinner. I've attached an image of the figure. Thanks very much, Colleen -------------- next part -------------- A non-text attachment was scrubbed... Name: Screen Shot 2019-04-12 at 4.50.09 PM.png Type: image/png Size: 228245 bytes Desc: not available URL: From frakkopesto at gmail.com Fri Apr 12 13:29:34 2019 From: frakkopesto at gmail.com (Franco Pestilli) Date: Fri, 12 Apr 2019 13:29:34 -0400 Subject: [Neuroimaging] 2019 Midwest Big Data Summer School In-Reply-To: References: Message-ID: <42940788-8645-4E7F-BBBC-A3659F90ECD8@gmail.com> Franco Pestilli, PhD Associate Professor Psychology , Neuroscience and Cognitive Science Engineering , Computer Science , and Optometry by courtesy ? Indiana University, Bloomington , IN 47405 franpest at indiana.edu | brainlife.io/plab Phone: +1 (812) 856 9967 > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: MidwestBigDataSummerSchool.pdf Type: application/pdf Size: 2496091 bytes Desc: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.taylor at imm.ox.ac.uk Tue Apr 23 03:07:34 2019 From: stephen.taylor at imm.ox.ac.uk (Stephen Taylor) Date: Tue, 23 Apr 2019 07:07:34 +0000 Subject: [Neuroimaging] How to set RGB values in NiBabel Message-ID: Hi, I don't understand how to set RGB values directly in NiBabel. I have seen the previous post ( https://mail.python.org/pipermail/neuroimaging/2016-November/001230.html) that gives random colours in a 3d matrix but I don't understand how to assign a specific RGB value in a particular voxel. So building on the previous example in the link, I create a 2 x 1 x 1 volume and change the values of the colours directly: import nibabel as nib import numpy as np nifti_path = "test.nii" shape_3d = (2,1,1) rgb_dtype = np.dtype([('R', 'u1'), ('G', 'u1'), ('B', 'u1')]) rgb_arr = np.random.randint(0, 256, size=shape_3d + (3,)).astype('u1') rgb_arr[0][0][0] = [100,150,200] rgb_arr[1][0][0] = [10,20,30] rgb_typed = rgb_arr.copy().view(rgb_dtype).reshape(shape_3d) img = nib.Nifti1Image(rgb_typed, np.eye(4)) print(rgb_typed) nib.save(img, nifti_path) The image that is returned ('test.nii') when inspected in Fiji/ImageJ looks like this: [image.png] and the rgb_typed array is: [[[(100, 150, 200)]] [[( 10, 20, 30)]]] However, in the actual image (shown above) the green colour RGB values are 100,200,020 (not as I expected 100,150,200)and the red colour is 150,010,030 (not as I expected 10,20,30) so the RGB values seem to be mixed up. Clearly I am doing something wrong. How do I directly set the colours of a voxel in a volume? Thanks, for any help, Steve ---------------------------------- Head of Analysis, Visualisation and Informatics, MRC Weatherall Institute of Molecular Medicine, Oxford. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 1550 bytes Desc: image001.png URL: From arokem at gmail.com Wed Apr 24 22:36:19 2019 From: arokem at gmail.com (Ariel Rokem) Date: Wed, 24 Apr 2019 19:36:19 -0700 Subject: [Neuroimaging] How to set RGB values in NiBabel In-Reply-To: References: Message-ID: Hi Steve, Not 100% sure. Maybe our implementation of something like this in DIPY can help? https://github.com/nipy/dipy/blob/master/dipy/io/utils.py#L49-L91 Cheers, Ariel On Tue, Apr 23, 2019 at 7:24 AM Stephen Taylor wrote: > Hi, > > > > I don't understand how to set RGB values directly in NiBabel. I have seen > the previous post ( > https://mail.python.org/pipermail/neuroimaging/2016-November/001230.html) > that gives random colours in a 3d matrix but I don't understand how to > assign a specific RGB value in a particular voxel. > > > > So building on the previous example in the link, I create a 2 x 1 x 1 > volume and change the values of the colours directly: > > > > import nibabel as nib > > import numpy as np > > nifti_path = "test.nii" > > > > shape_3d = (2,1,1) > > rgb_dtype = np.dtype([('R', 'u1'), ('G', 'u1'), ('B', 'u1')]) > > rgb_arr = np.random.randint(0, 256, size=shape_3d + (3,)).astype('u1') > > rgb_arr[0][0][0] = [100,150,200] > > rgb_arr[1][0][0] = [10,20,30] > > > > rgb_typed = rgb_arr.copy().view(rgb_dtype).reshape(shape_3d) > > > > img = nib.Nifti1Image(rgb_typed, np.eye(4)) > > print(rgb_typed) > > nib.save(img, nifti_path) > > > > The image that is returned (?test.nii?) when inspected in Fiji/ImageJ > looks like this: > > > > [image: image.png] > > > > and the rgb_typed array is: > > > > [[[(100, 150, 200)]] > > > > [[( 10, 20, 30)]]] > > > > However, in the actual image (shown above) the green colour RGB values are > 100,200,020 (not as I expected 100,150,200)and the red colour is > 150,010,030 (not as I expected 10,20,30) so the RGB values seem to be > mixed up. Clearly I am doing something wrong. How do I directly set the > colours of a voxel in a volume? > > > > Thanks, for any help, > > > > Steve > > ---------------------------------- > > Head of Analysis, Visualisation and Informatics, > > MRC Weatherall Institute of Molecular Medicine, > > Oxford. > > > > > > > > > > > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 1550 bytes Desc: not available URL: From dalton.sakthi at gmail.com Thu Apr 25 00:04:00 2019 From: dalton.sakthi at gmail.com (Dalton Sakthivadivel) Date: Thu, 25 Apr 2019 00:04:00 -0400 Subject: [Neuroimaging] OrthoSlicer3D Message-ID: <9D9654D6-F2E5-4F71-8922-F4656316C656@gmail.com> Dear nipy team, Can you describe to me some of the limitations on function that OrthoSlicer3D has? Is it limited to accepting images that are of the brain, or arrays of a certain size? OrthoSlicer3D does not work for my data and I can?t make heads nor tails of it. Rather than a typical output, it plots four black squares, as though I hadn?t put any data in at all. It may be an issue that my .nii file contains images which are not of the human brain. Otherwise I am at a loss. I can attach my code to this email at a later time. I would very much appreciate any help you had to give in this matter, including alternative suggestions for displaying typical 4D nifti images contained in .nii files. Thank you, Dalton Sakthivadivel From markiewicz at stanford.edu Thu Apr 25 08:23:13 2019 From: markiewicz at stanford.edu (Christopher Markiewicz) Date: Thu, 25 Apr 2019 12:23:13 +0000 Subject: [Neuroimaging] OrthoSlicer3D In-Reply-To: <9D9654D6-F2E5-4F71-8922-F4656316C656@gmail.com> References: <9D9654D6-F2E5-4F71-8922-F4656316C656@gmail.com> Message-ID: Hi Dalton, Without seeing the file or a screenshot, my best guess is that your affine matrix indicates the "center" of the image is in a corner and that the edges of the image are empty. Try clicking in the middle of each square to select different voxels. If there is content in the middle of your image, selecting a voxel in the center should reveal it. If you're calling `OrthoSlicer3D` directly, then your origin will be at (i, j, k) = (0, 0, 0), which will cause the situation I describe above. It will also treat your voxels as isotropic 1mm, which may not be correct. For NIfTI and other volumetric files, I would recommend the alternative `img.orthoview()`, which will pass the correct affine matrix by default. Also a quick note that OrthoSlicer3D doesn't work well on OSX. That may be another source of problems. Chris ________________________________ From: Neuroimaging on behalf of Dalton Sakthivadivel Sent: Thursday, April 25, 2019 12:04 AM To: neuroimaging at python.org Subject: [Neuroimaging] OrthoSlicer3D Dear nipy team, Can you describe to me some of the limitations on function that OrthoSlicer3D has? Is it limited to accepting images that are of the brain, or arrays of a certain size? OrthoSlicer3D does not work for my data and I can?t make heads nor tails of it. Rather than a typical output, it plots four black squares, as though I hadn?t put any data in at all. It may be an issue that my .nii file contains images which are not of the human brain. Otherwise I am at a loss. I can attach my code to this email at a later time. I would very much appreciate any help you had to give in this matter, including alternative suggestions for displaying typical 4D nifti images contained in .nii files. Thank you, Dalton Sakthivadivel _______________________________________________ Neuroimaging mailing list Neuroimaging at python.org https://mail.python.org/mailman/listinfo/neuroimaging -------------- next part -------------- An HTML attachment was scrubbed... URL: From dalton.sakthi at gmail.com Thu Apr 25 10:35:32 2019 From: dalton.sakthi at gmail.com (Dalton Sakthivadivel) Date: Thu, 25 Apr 2019 10:35:32 -0400 Subject: [Neuroimaging] OrthoSlicer3D Message-ID: <878B56B5-8049-40BF-9E33-FE0CA2CE7ECE@gmail.com> Thank you for your feedback. I will try out orthoview() as a viewer. From stephen.taylor at imm.ox.ac.uk Tue Apr 30 15:17:32 2019 From: stephen.taylor at imm.ox.ac.uk (Stephen Taylor) Date: Tue, 30 Apr 2019 19:17:32 +0000 Subject: [Neuroimaging] Neuroimaging Digest, Vol 47, Issue 8 In-Reply-To: References: Message-ID: Hi Ariel, Thanks for the link but I am still unsure of how this will work. I want to input a 3d array containing x, y, z coordinates with RGB values (tuples) but the img_orig parameter expects an image instance. I don't have an image and want to write one from scratch. Ideally input an array and then return an image. Sorry if I wasn't clear in my post. Kind regards and thanks, Steve ---------------------------------- Head of Analysis, Visualisation and Informatics MRC Weatherall Institute of Molecular Medicine Oxford ________________________________ From: Neuroimaging on behalf of neuroimaging-request at python.org Sent: Thursday, April 25, 2019 5:00:06 PM To: neuroimaging at python.org Subject: Neuroimaging Digest, Vol 47, Issue 8 Send Neuroimaging mailing list submissions to neuroimaging at python.org To subscribe or unsubscribe via the World Wide Web, visit https://mail.python.org/mailman/listinfo/neuroimaging or, via email, send a message with subject or body 'help' to neuroimaging-request at python.org You can reach the person managing the list at neuroimaging-owner at python.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Neuroimaging digest..." Today's Topics: 1. Re: How to set RGB values in NiBabel (Ariel Rokem) 2. OrthoSlicer3D (Dalton Sakthivadivel) 3. Re: OrthoSlicer3D (Christopher Markiewicz) 4. Re: OrthoSlicer3D (Dalton Sakthivadivel) ---------------------------------------------------------------------- Message: 1 Date: Wed, 24 Apr 2019 19:36:19 -0700 From: Ariel Rokem To: Neuroimaging analysis in Python Subject: Re: [Neuroimaging] How to set RGB values in NiBabel Message-ID: Content-Type: text/plain; charset="utf-8" Hi Steve, Not 100% sure. Maybe our implementation of something like this in DIPY can help? https://github.com/nipy/dipy/blob/master/dipy/io/utils.py#L49-L91 Cheers, Ariel On Tue, Apr 23, 2019 at 7:24 AM Stephen Taylor wrote: > Hi, > > > > I don't understand how to set RGB values directly in NiBabel. I have seen > the previous post ( > https://mail.python.org/pipermail/neuroimaging/2016-November/001230.html) > that gives random colours in a 3d matrix but I don't understand how to > assign a specific RGB value in a particular voxel. > > > > So building on the previous example in the link, I create a 2 x 1 x 1 > volume and change the values of the colours directly: > > > > import nibabel as nib > > import numpy as np > > nifti_path = "test.nii" > > > > shape_3d = (2,1,1) > > rgb_dtype = np.dtype([('R', 'u1'), ('G', 'u1'), ('B', 'u1')]) > > rgb_arr = np.random.randint(0, 256, size=shape_3d + (3,)).astype('u1') > > rgb_arr[0][0][0] = [100,150,200] > > rgb_arr[1][0][0] = [10,20,30] > > > > rgb_typed = rgb_arr.copy().view(rgb_dtype).reshape(shape_3d) > > > > img = nib.Nifti1Image(rgb_typed, np.eye(4)) > > print(rgb_typed) > > nib.save(img, nifti_path) > > > > The image that is returned (?test.nii?) when inspected in Fiji/ImageJ > looks like this: > > > > [image: image.png] > > > > and the rgb_typed array is: > > > > [[[(100, 150, 200)]] > > > > [[( 10, 20, 30)]]] > > > > However, in the actual image (shown above) the green colour RGB values are > 100,200,020 (not as I expected 100,150,200)and the red colour is > 150,010,030 (not as I expected 10,20,30) so the RGB values seem to be > mixed up. Clearly I am doing something wrong. How do I directly set the > colours of a voxel in a volume? > > > > Thanks, for any help, > > > > Steve > > ---------------------------------- > > Head of Analysis, Visualisation and Informatics, > > MRC Weatherall Institute of Molecular Medicine, > > Oxford. > > > > > > > > > > > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 1550 bytes Desc: not available URL: ------------------------------ Message: 2 Date: Thu, 25 Apr 2019 00:04:00 -0400 From: Dalton Sakthivadivel To: neuroimaging at python.org Subject: [Neuroimaging] OrthoSlicer3D Message-ID: <9D9654D6-F2E5-4F71-8922-F4656316C656 at gmail.com> Content-Type: text/plain; charset=utf-8 Dear nipy team, Can you describe to me some of the limitations on function that OrthoSlicer3D has? Is it limited to accepting images that are of the brain, or arrays of a certain size? OrthoSlicer3D does not work for my data and I can?t make heads nor tails of it. Rather than a typical output, it plots four black squares, as though I hadn?t put any data in at all. It may be an issue that my .nii file contains images which are not of the human brain. Otherwise I am at a loss. I can attach my code to this email at a later time. I would very much appreciate any help you had to give in this matter, including alternative suggestions for displaying typical 4D nifti images contained in .nii files. Thank you, Dalton Sakthivadivel ------------------------------ Message: 3 Date: Thu, 25 Apr 2019 12:23:13 +0000 From: Christopher Markiewicz To: Neuroimaging analysis in Python Subject: Re: [Neuroimaging] OrthoSlicer3D Message-ID: Content-Type: text/plain; charset="windows-1252" Hi Dalton, Without seeing the file or a screenshot, my best guess is that your affine matrix indicates the "center" of the image is in a corner and that the edges of the image are empty. Try clicking in the middle of each square to select different voxels. If there is content in the middle of your image, selecting a voxel in the center should reveal it. If you're calling `OrthoSlicer3D` directly, then your origin will be at (i, j, k) = (0, 0, 0), which will cause the situation I describe above. It will also treat your voxels as isotropic 1mm, which may not be correct. For NIfTI and other volumetric files, I would recommend the alternative `img.orthoview()`, which will pass the correct affine matrix by default. Also a quick note that OrthoSlicer3D doesn't work well on OSX. That may be another source of problems. Chris ________________________________ From: Neuroimaging on behalf of Dalton Sakthivadivel Sent: Thursday, April 25, 2019 12:04 AM To: neuroimaging at python.org Subject: [Neuroimaging] OrthoSlicer3D Dear nipy team, Can you describe to me some of the limitations on function that OrthoSlicer3D has? Is it limited to accepting images that are of the brain, or arrays of a certain size? OrthoSlicer3D does not work for my data and I can?t make heads nor tails of it. Rather than a typical output, it plots four black squares, as though I hadn?t put any data in at all. It may be an issue that my .nii file contains images which are not of the human brain. Otherwise I am at a loss. I can attach my code to this email at a later time. I would very much appreciate any help you had to give in this matter, including alternative suggestions for displaying typical 4D nifti images contained in .nii files. Thank you, Dalton Sakthivadivel _______________________________________________ Neuroimaging mailing list Neuroimaging at python.org https://mail.python.org/mailman/listinfo/neuroimaging -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 4 Date: Thu, 25 Apr 2019 10:35:32 -0400 From: Dalton Sakthivadivel To: neuroimaging at python.org Subject: Re: [Neuroimaging] OrthoSlicer3D Message-ID: <878B56B5-8049-40BF-9E33-FE0CA2CE7ECE at gmail.com> Content-Type: text/plain; charset=us-ascii Thank you for your feedback. I will try out orthoview() as a viewer. ------------------------------ Subject: Digest Footer _______________________________________________ Neuroimaging mailing list Neuroimaging at python.org https://mail.python.org/mailman/listinfo/neuroimaging ------------------------------ End of Neuroimaging Digest, Vol 47, Issue 8 ******************************************* -------------- next part -------------- An HTML attachment was scrubbed... URL: