Re: [HCP-Users] gradient nonlinearity correction question

2018-04-12 Thread Kristian Loewe
Hi,

>> Note that this will not be the case for 2D (eg EPI) data because
>> on-scanner can only be done 2D - so that won't match post-hoc 3D
>> correction.

> I was under the assumption that the correction couldn't be done for EPI
> on the scanner at all. I don't operate the scanner myself but one of the
> local MR physicists tried to activate it upon my request and the
> relevant checkbox appeared to be disabled in the scanner software. Have
> you got a special software version that allows you to use it?

I checked again and it seems that I can't make the scanner software  
apply the correction to fMRI data during data acquisition but I can,  
in principle, apply 2D or 3D correction to fMRI data afterwards. This  
only works, though, after splitting up the MOSAIC data. The software  
version we are using on the scanner is VE11.

Cheers,

Kristian


Quoting Kristian Loewe <k...@kristianloewe.com>:

> Hi Steve,
>
>> Hi - no, in my experience running the post-hoc correction should
>> look virtually identical to the on-scanner correction.
> Thanks! At least it's clear then that I should keep looking into this.
>
>> Note that this will not be the case for 2D (eg EPI) data because
>> on-scanner can only be done 2D - so that won't match post-hoc 3D
>> correction.
> I was under the assumption that the correction couldn't be done for EPI
> on the scanner at all. I don't operate the scanner myself but one of the
> local MR physicists tried to activate it upon my request and the
> relevant checkbox appeared to be disabled in the scanner software. Have
> you got a special software version that allows you to use it?
>
> Cheers,
>
> Kristian
>
>
> On 11.04.2018 18:54, Stephen Smith wrote:
>> Hi - no, in my experience running the post-hoc correction should look
>> virtually identical to the on-scanner correction.
>>
>> Note that this will not be the case for 2D (eg EPI) data because
>> on-scanner can only be done 2D - so that won't match post-hoc 3D correction.
>>
>> Cheers.
>>
>>
>>
>>
>>> On 11 Apr 2018, at 17:51, Kristian Loewe <k...@kristianloewe.com
>>> <mailto:k...@kristianloewe.com>> wrote:
>>>
>>> Hi Michael,
>>>
>>> Thanks for the suggestion! By default, we are using the 3D correction on
>>> the scanner. But I applied the 2D correction to the ND data set
>>> separately to see what it looks like. The result is different from both
>>> the 3D-scanner-correction and the offline-correction but looks
>>> reasonable too.
>>>
>>> Is it the case that for HCP data the scanner-corrected images look
>>> almost exactly the same as the offline-corrected images or is it
>>> ok/normal for them to differ a bit, especially further away from the
>>> isocenter?
>>>
>>> Cheers,
>>>
>>> Kristian
>>>
>>>
>>> On 11.04.2018 15:42, Harms, Michael wrote:
>>>>
>>>> One thought: Are you sure you are using the “3D” (and not the “2D”)
>>>> correction on the scanner?
>>>>
>>>> --
>>>> Michael Harms, Ph.D.
>>>>
>>>> ---
>>>>
>>>> Associate Professor of Psychiatry
>>>>
>>>> Washington University School of Medicine
>>>>
>>>> Department of Psychiatry, Box 8134
>>>>
>>>> 660 South Euclid Ave.    Tel: 314-747-6173
>>>>
>>>> St. Louis, MO  63110 Email: mha...@wustl.edu <mailto:mha...@wustl.edu>
>>>>
>>>> On 4/11/18, 8:31 AM, "hcp-users-boun...@humanconnectome.org
>>>> <mailto:hcp-users-boun...@humanconnectome.org> on behalf of Kristian
>>>> Loewe" <hcp-users-boun...@humanconnectome.org
>>>> <mailto:hcp-users-boun...@humanconnectome.org> on behalf of
>>>> k...@kristianloewe.com <mailto:k...@kristianloewe.com>> wrote:
>>>>
>>>> Hi Joo-won and Keith,
>>>>
>>>> I don't think that the table has been moved. Is there any information
>>>> somewhere in the dicom header to double-check this?
>>>>
>>>> I am using the coeff_AS82.grad file for the Prisma data (the second
>>>> command). The first command was what I used for the Verio data. Also,
>>>> I double-checked that I am using the uncorrected volume as input.
>>>>
>>>> I am not sure if I am supposed/allowed to send screenshots of the
>>>> actual data in the subjec

Re: [HCP-Users] gradient nonlinearity correction question

2018-04-11 Thread Kristian Loewe
Hi Steve,

> Hi - no, in my experience running the post-hoc correction should
> look virtually identical to the on-scanner correction.
Thanks! At least it's clear then that I should keep looking into this.

> Note that this will not be the case for 2D (eg EPI) data because 
> on-scanner can only be done 2D - so that won't match post-hoc 3D 
> correction.
I was under the assumption that the correction couldn't be done for EPI 
on the scanner at all. I don't operate the scanner myself but one of the 
local MR physicists tried to activate it upon my request and the 
relevant checkbox appeared to be disabled in the scanner software. Have 
you got a special software version that allows you to use it?

Cheers,

Kristian


On 11.04.2018 18:54, Stephen Smith wrote:
> Hi - no, in my experience running the post-hoc correction should look 
> virtually identical to the on-scanner correction.
> 
> Note that this will not be the case for 2D (eg EPI) data because 
> on-scanner can only be done 2D - so that won't match post-hoc 3D correction.
> 
> Cheers.
> 
> 
> 
> 
>> On 11 Apr 2018, at 17:51, Kristian Loewe <k...@kristianloewe.com 
>> <mailto:k...@kristianloewe.com>> wrote:
>>
>> Hi Michael,
>>
>> Thanks for the suggestion! By default, we are using the 3D correction on
>> the scanner. But I applied the 2D correction to the ND data set
>> separately to see what it looks like. The result is different from both
>> the 3D-scanner-correction and the offline-correction but looks
>> reasonable too.
>>
>> Is it the case that for HCP data the scanner-corrected images look
>> almost exactly the same as the offline-corrected images or is it
>> ok/normal for them to differ a bit, especially further away from the
>> isocenter?
>>
>> Cheers,
>>
>> Kristian
>>
>>
>> On 11.04.2018 15:42, Harms, Michael wrote:
>>>
>>> One thought: Are you sure you are using the “3D” (and not the “2D”) 
>>> correction on the scanner?
>>>
>>> --
>>> Michael Harms, Ph.D.
>>>
>>> ---
>>>
>>> Associate Professor of Psychiatry
>>>
>>> Washington University School of Medicine
>>>
>>> Department of Psychiatry, Box 8134
>>>
>>> 660 South Euclid Ave.    Tel: 314-747-6173
>>>
>>> St. Louis, MO  63110 Email: mha...@wustl.edu <mailto:mha...@wustl.edu>
>>>
>>> On 4/11/18, 8:31 AM, "hcp-users-boun...@humanconnectome.org 
>>> <mailto:hcp-users-boun...@humanconnectome.org> on behalf of Kristian 
>>> Loewe" <hcp-users-boun...@humanconnectome.org 
>>> <mailto:hcp-users-boun...@humanconnectome.org> on behalf of 
>>> k...@kristianloewe.com <mailto:k...@kristianloewe.com>> wrote:
>>>
>>> Hi Joo-won and Keith,
>>>
>>> I don't think that the table has been moved. Is there any information
>>> somewhere in the dicom header to double-check this?
>>>
>>> I am using the coeff_AS82.grad file for the Prisma data (the second
>>> command). The first command was what I used for the Verio data. Also,
>>> I double-checked that I am using the uncorrected volume as input.
>>>
>>> I am not sure if I am supposed/allowed to send screenshots of the
>>> actual data in the subject's native space to the list. I'm going to
>>> check that. Meanwhile, I asked our local MR team to acquire an
>>> additional data set using a phantom. The difference between the
>>> scanner-corrected image and the offline-corrected image is not as
>>> striking in this case but it's visible. Based on the phantom data, I
>>> am inclined to say that both corrections work reasonably well, even
>>> though they are not exactly the same. I also tried the
>>> offline-correction on some phantom EPI data and it seems to work well
>>> as it (together with EPI distortion correction) restores the original
>>> shape of the phantom pretty nicely.
>>>
>>> The differences between the correction variants applied to the
>>> subject's data are actually rather small inside the brain but become
>>> larger towards the neck, which is to be expected as the distance to
>>> the magnetic isocenter becomes greater in that direction.
>>> Nevertheless, I orginally thought that the differences between
>>> scanner- and offline-corrected images would be smaller than that.
>>>
>>> Find attached some plots of the T1 phantom data:
>>>
>>> T1_ND*.png -

Re: [HCP-Users] gradient nonlinearity correction question

2018-04-11 Thread Kristian Loewe
Hi Joo-won,

I am not sure, which one looks more anatomically reasonable. The 
scanner-corrected one looks a little bit more crisp compared to the 
offline-corrected, which appears a little more smooth by comparison. 
Perhaps this could have something to do with the interpolation algorithm 
used?

Thanks for the information regarding the table position! That's good to 
know. It reports as 0\0\0, though.

Cheers,

Kristian


On 11.04.2018 16:19, Kim, Joo-won wrote:
> Hi Kristian,
> 
> Which one looks more reasonable, online or offline correction for subject 
> data?
> 
> On my data, dicom header (0019, 1014) contains table position.
> 
> Best,
> Joo-won
> 
> On 4/11/18, 9:31 AM, "Kristian Loewe" <k...@kristianloewe.com> wrote:
> 
>  Hi Joo-won and Keith,
>  
>  I don't think that the table has been moved. Is there any information
>  somewhere in the dicom header to double-check this?
>  
>  I am using the coeff_AS82.grad file for the Prisma data (the second
>  command). The first command was what I used for the Verio data. Also,
>  I double-checked that I am using the uncorrected volume as input.
>  
>  I am not sure if I am supposed/allowed to send screenshots of the
>  actual data in the subject's native space to the list. I'm going to
>  check that. Meanwhile, I asked our local MR team to acquire an
>  additional data set using a phantom. The difference between the
>  scanner-corrected image and the offline-corrected image is not as
>  striking in this case but it's visible. Based on the phantom data, I
>  am inclined to say that both corrections work reasonably well, even
>  though they are not exactly the same. I also tried the
>  offline-correction on some phantom EPI data and it seems to work well
>  as it (together with EPI distortion correction) restores the original
>  shape of the phantom pretty nicely.
>  
>  The differences between the correction variants applied to the
>  subject's data are actually rather small inside the brain but become
>  larger towards the neck, which is to be expected as the distance to
>  the magnetic isocenter becomes greater in that direction.
>  Nevertheless, I orginally thought that the differences between
>  scanner- and offline-corrected images would be smaller than that.
>  
>  Find attached some plots of the T1 phantom data:
>  
>  T1_ND*.png - uncorrected images
>  T1*.png- scanner-corrected images
>  T1_ND_gdc*.png - offline-corrected images
>  
>  Cheers,
>  
>  Kristian
>  
>  
>  PS:
>  I am sending this email for the second time (apparently the attachment
>  was too large). I am not sure if the first email was successfully
>  cancelled. I apologize if you are receiving this twice now.
>  
>  
>  Quoting "Kim, Joo-won" <joo-won@mssm.edu>:
>  
>  > Hi Kristian,
>  >
>  > Have you moved table? If you moved the table, you should manually
>  > subtract it from qform, sform, and/or affine matrix in the nifty
>  > header.
>  >
>  > Best,
>  > Joo-won
>  >
>  > ---
>  > Joo-won Kim, Ph.D.
>  > Postdoctoral Fellow
>  > Translational and Molecular Imaging Institute
>  > Icahn School of Medicine at Mount Sinai
>  >
>  >
>  > From: <hcp-users-boun...@humanconnectome.org> on behalf of Keith
>  > Jamison <kjami...@umn.edu>
>  > Date: Monday, April 9, 2018 at 10:36 AM
>  > To: Kristian Loewe <k...@kristianloewe.com>
>  > Cc: HCP Users <hcp-users@humanconnectome.org>
>  > Subject: Re: [HCP-Users] gradient nonlinearity correction question
>  >
>  > First make sure you're using the right coefficient file, copied
>  > directly from the scanner.  The Prisma should have a file called
>  > coeff_AS82.grad, so the one you used in your *second* command above
>  > should be correct.
>  > Second is to be absolutely sure your input is the uncorrected volume 
> (*_ND).
>  > If you include some matched screenshots of the uncorrected,
>  > offline-corrected, and scanner-corrected volumes, we can maybe help
>  > evaluate the difference.
>  >
>  >
>  > On Mon, Apr 9, 2018 at 4:09 AM, Kristian Loewe
>  > <k...@kristianloewe.com<mailto:k...@kristianloewe.com>> wrote:
>  > Thanks Keith,
>  >
>  > Cropping is turned off by default in the version of dcm2niix that
>  &

Re: [HCP-Users] gradient nonlinearity correction question

2018-04-11 Thread Kristian Loewe
Hi Michael,

Thanks for the suggestion! By default, we are using the 3D correction on 
the scanner. But I applied the 2D correction to the ND data set 
separately to see what it looks like. The result is different from both 
the 3D-scanner-correction and the offline-correction but looks 
reasonable too.

Is it the case that for HCP data the scanner-corrected images look 
almost exactly the same as the offline-corrected images or is it 
ok/normal for them to differ a bit, especially further away from the 
isocenter?

Cheers,

Kristian


On 11.04.2018 15:42, Harms, Michael wrote:
> 
> One thought: Are you sure you are using the “3D” (and not the “2D”) 
> correction on the scanner?
> 
> --
> Michael Harms, Ph.D.
> 
> ---
> 
> Associate Professor of Psychiatry
> 
> Washington University School of Medicine
> 
> Department of Psychiatry, Box 8134
> 
> 660 South Euclid Ave.Tel: 314-747-6173
> 
> St. Louis, MO  63110  Email: mha...@wustl.edu
> 
> On 4/11/18, 8:31 AM, "hcp-users-boun...@humanconnectome.org on behalf of 
> Kristian Loewe" <hcp-users-boun...@humanconnectome.org on behalf of 
> k...@kristianloewe.com> wrote:
> 
> Hi Joo-won and Keith,
> 
> I don't think that the table has been moved. Is there any information
> somewhere in the dicom header to double-check this?
> 
> I am using the coeff_AS82.grad file for the Prisma data (the second
> command). The first command was what I used for the Verio data. Also,
> I double-checked that I am using the uncorrected volume as input.
> 
> I am not sure if I am supposed/allowed to send screenshots of the
> actual data in the subject's native space to the list. I'm going to
> check that. Meanwhile, I asked our local MR team to acquire an
> additional data set using a phantom. The difference between the
> scanner-corrected image and the offline-corrected image is not as
> striking in this case but it's visible. Based on the phantom data, I
> am inclined to say that both corrections work reasonably well, even
> though they are not exactly the same. I also tried the
> offline-correction on some phantom EPI data and it seems to work well
> as it (together with EPI distortion correction) restores the original
> shape of the phantom pretty nicely.
> 
> The differences between the correction variants applied to the
> subject's data are actually rather small inside the brain but become
> larger towards the neck, which is to be expected as the distance to
> the magnetic isocenter becomes greater in that direction.
> Nevertheless, I orginally thought that the differences between
> scanner- and offline-corrected images would be smaller than that.
> 
> Find attached some plots of the T1 phantom data:
> 
> T1_ND*.png - uncorrected images
> T1*.png- scanner-corrected images
> T1_ND_gdc*.png - offline-corrected images
> 
> Cheers,
> 
> Kristian
> 
> 
> PS:
> I am sending this email for the second time (apparently the attachment
> was too large). I am not sure if the first email was successfully
> cancelled. I apologize if you are receiving this twice now.
> 
> 
> Quoting "Kim, Joo-won" <joo-won@mssm.edu>:
> 
>> Hi Kristian,
>>
>> Have you moved table? If you moved the table, you should manually
>> subtract it from qform, sform, and/or affine matrix in the nifty
>> header.
>>
>> Best,
>> Joo-won
>>
>> ---
>> Joo-won Kim, Ph.D.
>> Postdoctoral Fellow
>> Translational and Molecular Imaging Institute
>> Icahn School of Medicine at Mount Sinai
>>
>>
>> From: <hcp-users-boun...@humanconnectome.org> on behalf of Keith
>> Jamison <kjami...@umn.edu>
>> Date: Monday, April 9, 2018 at 10:36 AM
>> To: Kristian Loewe <k...@kristianloewe.com>
>> Cc: HCP Users <hcp-users@humanconnectome.org>
>> Subject: Re: [HCP-Users] gradient nonlinearity correction question
>>
>> First make sure you're using the right coefficient file, copied
>> directly from the scanner.  The Prisma should have a file called
>> coeff_AS82.grad, so the one you used in your *second* command above
>> should be correct.
>> Second is to be absolutely sure your input is the uncorrected volume (*_ND).
>> If you include some matched screenshots of the uncorrected,
>> offline-corrected, and scanner-corrected volumes, we can maybe help
>> evaluate the difference.
>>
>>
>> On Mon, Apr 9, 2018 at 4:09 AM, Kristian Loewe
>> <k...@kristianloewe.com<mailto:k...@kristianloewe.com>> wrote:
>> Thanks Keith,
>>
>> Cropping is t

Re: [HCP-Users] gradient nonlinearity correction question

2018-04-09 Thread Kristian Loewe
Thanks Keith,

Cropping is turned off by default in the version of dcm2niix that I'm  
using but I re-ran the conversion with "-x n" anyway. I also used  
fslreorient2std as per your suggestion. Unfortunately, the result is  
still the same. Do you have any other ideas?

Cheers,

Kristian


Quoting Keith Jamison <kjami...@umn.edu>:

> Some problems can arrise if the NIFTI files are unexpectedly manipulated
> prior gradient_unwarp. Two things to check:
>
> 1. dcm2nii and dcm2niix has options to perform additional processing like
> reorienting or cropping, some of which may be enabled by default. Make sure
> those are all DISABLED. (for dcm2niix add "-x n" and for dcm2nii you can
> add "-x N -r N"
> 2. We also usually use "fslreorient2std  _new and then
> gradient_unwarp.py on _new
>
> -Keith
>
>
> On Fri, Apr 6, 2018 at 12:05 PM, Kristian Loewe <k...@kristianloewe.com>
> wrote:
>
>> Hi,
>>
>> I would like to use gradunwarp for offline gradient nonlinearity
>> correction of some data acquired on our local Siemens scanners. I used
>> dcm2niix to convert the dicom data to nifti format. After applying
>> gradunwarp to a T1 image in nifti format (the one that originally has
>> the _ND suffix), I proceeded to compare the result with the
>> Siemens-corrected T1 image. I expected that they would look very
>> similar but in fact they look quite different. I am wondering if this
>> is to be expected to some degree because of differences in the
>> correction algorithms or what else might be the reason for this. Could
>> it be the case, for example, that the wrong center is being used for
>> some reason?
>>
>> I have tried this for a T1 image acquired on a Verio and another one
>> from a Prisma using
>>
>>gradient_unwarp.py T1.nii.gz T1_gdc.nii.gz siemens -g coeff_AS097.grad
>> -n
>>
>> and
>>
>>gradient_unwarp.py T1.nii.gz T1_gdc.nii.gz siemens -g coeff_AS82.grad -n
>>
>> respectively.
>>
>> I would really appreciate any help or advice you can provide.
>>
>> Cheers,
>>
>> Kristian
>>
>>
>> Quoting Keith Jamison <kjami...@umn.edu>:
>>
>> > FYI, when available, you can enable it on the scanner in the
>> > "Resolution->Filter" tab with the "Distortion Correction" checkbox.  It's
>> > often used for structural scans like MPRAGE, where you will see two DICOM
>> > folders in the output:  and _ND.  ND means "No
>> > Distortion [Correction]".. .A very confusing choice of acronym.  You can
>> > then compare the online corrected (not _ND) and offline using gradunwarp.
>> >
>> > -Keith
>> >
>> >
>> > On Wed, Oct 19, 2016 at 4:44 PM, Glasser, Matthew <glass...@wustl.edu>
>> > wrote:
>> >
>> >> Some do for some sequences, but because it is not uniformly applied and
>> >> because they are likely not to use optimal interpolation algorithms, we
>> >> prefer to do offline correction.
>> >>
>> >> Peace,
>> >>
>> >> Matt.
>> >>
>> >> From: <hcp-users-boun...@humanconnectome.org> on behalf of Antonin
>> Skoch <
>> >> a...@ikem.cz>
>> >> Date: Wednesday, October 19, 2016 at 4:27 PM
>> >> To: "hcp-users@humanconnectome.org" <hcp-users@humanconnectome.org>
>> >> Subject: [HCP-Users] gradient nonlinearity correction question
>> >>
>> >> Dear experts,
>> >>
>> >> during the set-up of gradunwarp scripts, it came to my mind, why scanner
>> >> vendors standardly do not perform gradient nonlinearity correction
>> directly
>> >> on the scanner as part of on-line image reconstruction system (i.e. ICE
>> in
>> >> Siemens)?
>> >>
>> >> Regards,
>> >>
>> >> Antonin Skoch
>> >>
>> >>
>> >> ___
>> >> HCP-Users mailing list
>> >> HCP-Users@humanconnectome.org
>> >> http://lists.humanconnectome.org/mailman/listinfo/hcp-users
>> >>
>> >>
>> >> --
>> >>
>> >> The materials in this message are private and may contain Protected
>> >> Healthcare Information or other information of a sensitive nature. If
>> you
>> >> are not the intended recipient, be advised that any unauthorized use,
>> >> disclosure, copying or the taking of any action in reliance on the
>> contents
>> >> of this information is strictly prohibited. If you have received this
>> email
>> >> in error, please immediately notify the sender via telephone or return
>> mail.
>> >>
>> >> ___
>> >> HCP-Users mailing list
>> >> HCP-Users@humanconnectome.org
>> >> http://lists.humanconnectome.org/mailman/listinfo/hcp-users
>> >>
>> >
>> > ___
>> > HCP-Users mailing list
>> > HCP-Users@humanconnectome.org
>> > http://lists.humanconnectome.org/mailman/listinfo/hcp-users
>>
>>
>>
>> ___
>> HCP-Users mailing list
>> HCP-Users@humanconnectome.org
>> http://lists.humanconnectome.org/mailman/listinfo/hcp-users
>>



___
HCP-Users mailing list
HCP-Users@humanconnectome.org
http://lists.humanconnectome.org/mailman/listinfo/hcp-users


Re: [HCP-Users] gradient nonlinearity correction question

2018-04-06 Thread Kristian Loewe
Hi,

I would like to use gradunwarp for offline gradient nonlinearity  
correction of some data acquired on our local Siemens scanners. I used  
dcm2niix to convert the dicom data to nifti format. After applying  
gradunwarp to a T1 image in nifti format (the one that originally has  
the _ND suffix), I proceeded to compare the result with the  
Siemens-corrected T1 image. I expected that they would look very  
similar but in fact they look quite different. I am wondering if this  
is to be expected to some degree because of differences in the  
correction algorithms or what else might be the reason for this. Could  
it be the case, for example, that the wrong center is being used for  
some reason?

I have tried this for a T1 image acquired on a Verio and another one  
from a Prisma using

   gradient_unwarp.py T1.nii.gz T1_gdc.nii.gz siemens -g coeff_AS097.grad -n

and

   gradient_unwarp.py T1.nii.gz T1_gdc.nii.gz siemens -g coeff_AS82.grad -n

respectively.

I would really appreciate any help or advice you can provide.

Cheers,

Kristian


Quoting Keith Jamison :

> FYI, when available, you can enable it on the scanner in the
> "Resolution->Filter" tab with the "Distortion Correction" checkbox.  It's
> often used for structural scans like MPRAGE, where you will see two DICOM
> folders in the output:  and _ND.  ND means "No
> Distortion [Correction]".. .A very confusing choice of acronym.  You can
> then compare the online corrected (not _ND) and offline using gradunwarp.
>
> -Keith
>
>
> On Wed, Oct 19, 2016 at 4:44 PM, Glasser, Matthew 
> wrote:
>
>> Some do for some sequences, but because it is not uniformly applied and
>> because they are likely not to use optimal interpolation algorithms, we
>> prefer to do offline correction.
>>
>> Peace,
>>
>> Matt.
>>
>> From:  on behalf of Antonin Skoch <
>> a...@ikem.cz>
>> Date: Wednesday, October 19, 2016 at 4:27 PM
>> To: "hcp-users@humanconnectome.org" 
>> Subject: [HCP-Users] gradient nonlinearity correction question
>>
>> Dear experts,
>>
>> during the set-up of gradunwarp scripts, it came to my mind, why scanner
>> vendors standardly do not perform gradient nonlinearity correction directly
>> on the scanner as part of on-line image reconstruction system (i.e. ICE in
>> Siemens)?
>>
>> Regards,
>>
>> Antonin Skoch
>>
>>
>> ___
>> HCP-Users mailing list
>> HCP-Users@humanconnectome.org
>> http://lists.humanconnectome.org/mailman/listinfo/hcp-users
>>
>>
>> --
>>
>> The materials in this message are private and may contain Protected
>> Healthcare Information or other information of a sensitive nature. If you
>> are not the intended recipient, be advised that any unauthorized use,
>> disclosure, copying or the taking of any action in reliance on the contents
>> of this information is strictly prohibited. If you have received this email
>> in error, please immediately notify the sender via telephone or return mail.
>>
>> ___
>> HCP-Users mailing list
>> HCP-Users@humanconnectome.org
>> http://lists.humanconnectome.org/mailman/listinfo/hcp-users
>>
>
> ___
> HCP-Users mailing list
> HCP-Users@humanconnectome.org
> http://lists.humanconnectome.org/mailman/listinfo/hcp-users



___
HCP-Users mailing list
HCP-Users@humanconnectome.org
http://lists.humanconnectome.org/mailman/listinfo/hcp-users


Re: [HCP-Users] Export the colormaps of Connectome Workbench into the MATLAB

2016-09-05 Thread Kristian Loewe
Hi Aaron,

I'm not sure if it is possible to export the colormaps directly. In any 
case, I think that one could recreate the colormaps based on the 
relevant code sections (take a look at 
https://github.com/Washington-University/workbench/blob/ddbb8f82be40f93a96255035f1db163d624f676f/src/Files/PaletteFile.cxx).
 
Here is an example that I put together for the videen_style colormap 
(untested):

function map = videen(n)

if nargin < 1
   n = size(get(gcf, 'Colormap'), 1);
end

values = [...
'ff'; '00'; '00';  % red
'ff'; '69'; '00';  % orange
'ff'; '99'; '00';  % oran-yell
'ff'; 'ff'; '00';  % yellow
'10'; 'b0'; '10';  % limegreen
'00'; 'ff'; '00';  % green
'7f'; '7f'; 'cc';  % blue_videen7
'4c'; '4c'; '7f';  % blue_videen9
'33'; '33'; '4c';  % blue_videen11
'66'; '00'; '33';  % purple2
'00'; '00'; '00';  % black
'00'; 'ff'; 'ff';  % cyan
'00'; 'ff'; '00';  % green
'10'; 'b0'; '10';  % limegreen
'e2'; '51'; 'e2';  % violet
'ff'; '38'; '8d';  % hotpink
'ff'; 'ff'; 'ff';  % white
'dd'; 'dd'; 'dd';  % gry-dd
'bb'; 'bb'; 'bb';  % gry-bb
'00'; '00'; '00']; % black

values = reshape(hex2dec(values), [3 numel(values)/6])' ./ 255;

P = size(values,1);

map = interp1(1:size(values,1), values, linspace(1,P,n), 'linear');

end


Cheers,
Kris


On 05.09.2016 19:01, Aaron C wrote:
> Dear HCP experts,
>
>
> I see the colormaps used in Connectome Workbench are very nice. I am
> wondering if there is a way to export the colormaps of Connectome
> Workbench into the MATLAB. I am particularly interested in using the
> Workbench colormap "videen_style" in the MATLAB. Thank you.
>
> ___
> HCP-Users mailing list
> HCP-Users@humanconnectome.org
> http://lists.humanconnectome.org/mailman/listinfo/hcp-users
>
___
HCP-Users mailing list
HCP-Users@humanconnectome.org
http://lists.humanconnectome.org/mailman/listinfo/hcp-users