Re: [HCP-Users] Question about workbench calculation

2018-12-28 Thread Timothy Coalson
If you mean you just want to combine the magnitudes (the main output of
-cifti-gradient) across timepoints, that isn't hard.  There isn't a built
in option to do it, but you can do it afterwards by -cifti-math to square
everything, -cifti-reduce to sum across time, and then -cifti-math to
square root afterwards.  L2 norm may be a candidate for adding to
-cifti-reduce.

If you want the partials separated by spatial direction (dx, dy, dz), that
is a bit more involved to combine across timepoints, as the vector output
option has 3x as many maps, and they are interleaved (dx1, dy1, dz1, dx2,
dy2, etc).  You would need to build some long -cifti-separate commands to
make a file containing (dx1, dx2, dx3, etc), and similar for y and z.  In
hindsight, outputting 3 files from that option would probably have been a
better design.

Tim


On Fri, Dec 28, 2018 at 1:07 PM Montez, David 
wrote:

> Hi HCP workbench folks,
>
> I’m trying to perform a particular calculation on a resting state data set
> using wb_command and, if possible, would like some advice on how to go
> about it most directly.
>
> I’d like to compute the magnitude of a gradient at each point
> (voxel/vertex) on a surface and volume for a case in which each
> voxel/vertex corresponds to a vector valued function.
>
> To be explicit consider a volumetric data set V(x,y,z,t), where x,y,z are
> spatial coordinates and t is a time point. This could be just a typical
> resting state scan. Let  0 ≤ t ≤ m, where m is the last time point.
>
> For a given location, x0, y0,z0, the magnitude of the partial vector
> derivative dV/dx is given by:
>
> note:  vector magnitudes are denoted by || || and is just a typical L2 norm
>
> || dV/dx || = || V(x0+dx ,y0 ,z0, t=0,1,2,….t=m) - V(x0, y0, z0,
> t=0,1,2,….t=m) ||
>
> This is basically the magnitude of the vector difference of time series
> for two adjacent voxels
>
> It would appear that the workbench command -cifti-gradient is the
> appropriate starting place, but it is unclear how the command should be set
> up since computing the L2-norm would require calculating the sum-of-squares
> of the differences across all time points and the only option that I see is
> available is -average-output which would not serve my purpose if would
> simply perform the arithmetic mean across the time points if the difference
>
> This would be a relatively easy thing to implement in volume space, but
> I’d like to take advantage of working in surface-land for all of the usual
> reasons.
>
> Can you advise on what would be the most straightforward way to perform
> the calculation for || dV/dx || as outlined above.
>
> Many thanks!
>
> David Montez
>
>
>
> 
> 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] Question about workbench calculation

2018-12-28 Thread Montez, David
Hi HCP workbench folks,

I’m trying to perform a particular calculation on a resting state data set 
using wb_command and, if possible, would like some advice on how to go about it 
most directly.

I’d like to compute the magnitude of a gradient at each point (voxel/vertex) on 
a surface and volume for a case in which each voxel/vertex corresponds to a 
vector valued function.

To be explicit consider a volumetric data set V(x,y,z,t), where x,y,z are 
spatial coordinates and t is a time point. This could be just a typical resting 
state scan. Let  0 ≤ t ≤ m, where m is the last time point.

For a given location, x0, y0,z0, the magnitude of the partial vector derivative 
dV/dx is given by:

note:  vector magnitudes are denoted by || || and is just a typical L2 norm

|| dV/dx || = || V(x0+dx ,y0 ,z0, t=0,1,2,….t=m) - V(x0, y0, z0, t=0,1,2,….t=m) 
||

This is basically the magnitude of the vector difference of time series for two 
adjacent voxels

It would appear that the workbench command -cifti-gradient is the appropriate 
starting place, but it is unclear how the command should be set up since 
computing the L2-norm would require calculating the sum-of-squares of the 
differences across all time points and the only option that I see is available 
is -average-output which would not serve my purpose if would simply perform the 
arithmetic mean across the time points if the difference

This would be a relatively easy thing to implement in volume space, but I’d 
like to take advantage of working in surface-land for all of the usual reasons.

Can you advise on what would be the most straightforward way to perform the 
calculation for || dV/dx || as outlined above.

Many thanks!

David Montez




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