7:33 AM
Rearranging a 3D array is rather difficult! Any tips y'all might see fit to share with me? So far I figured out a rather convoluted way to chop the `Fourier`'d array into eighths and have joined 1 pair into quarters successfully. I found that `CenterArray` in combination with `DiskMatrix3D` found above makes for a very nice and symmetric array to chop up, but I'm sure its easy with an odd one, too..but there must be some built in method one could use for this?! Or an algorithm to follow at least

8:06 AM
If anyone is bored:
```centered32fft = CenterArray[DiskMatrix3D[32], {256, 256, 256}] // Fourier;
Table[ArrayFlatten[{{centered32fft[[i, ;; 128, -128 ;;]],
centered32fft[[i, ;; 128, ;; 128]]}}], {i, 1,
Length@centered32fft/2, 1}]```
That gives my attempt at linking up two of the eighths. Not too sure what to do at the moment since concatenating this even more gives me `{128,128,512}` dimensions instead of `{128,256,256}` as I'd hope for

1 hour later…
9:13 AM
@CATrevillian Are you looking for something like `Partition` but with a multidimensional second argument?
And by "like" I mean are you looking for `Partition` itself

@b3m2a1 Perhaps? I have no problem with chopping the array up, it is the reassembling that is the issue for me. I'd essentially like to perform some sort of phase-fixing on the output of `Fourier` applied to 3D arrays. It seems to me that this may be possible with `Partition` using something other than +/-1 for `{kL,kR}` but the intricacies are lost on me

@CATrevillian Is this phase fixing akin to putting the values at the corners at the center, as is commonly done in 2D? Maybe we could help if we understood it better.

9:35 AM
Yes exactly this @C.E. ! Apologies on the vagueness
I tried `Map`ping a phase fixed FFT2D implementation I had found here over each 2D slice, but I quickly realized why that would not work. I'm thinking It shouldn't be too complicated in the end, but so far all I can muster is what I shared above, it's probably something with `Tuples` (How to chop it up into the upper & lower quadrants) and a creative application of `ArrayFlatten` maybe? I could also see the long road working, that is just chopping it in half & reassembling it several times.
I see semblances of elegance, but all I have is a pile of stuff right now, haha!

I will think about it and see if I can come up with something.

9:59 AM
Thank you! It will be cool to see this automated, and it'll be even cooler if it is cool to see how this is automated ;D Appreciate your consideration.

10:22 AM
`Image3D@RotateLeft[#, Floor[Dimensions@#/2]] &@CenterArray[DiskMatrix3D[64, 32], {128, 128, 128}]`
@CATrevillian ^ Is this what you're looking for?

Yep, I think that's it. I was just going to suggest it.

10:38 AM
@CATrevillian, on the matter of rearranging your data for FFT, have you seen this?
(And just for fun, see this as well.)

@LukasLang :D
@J.M.willbebacksoon :o
To translate: @LukasLang that's precisely perfect, and @J.M.willbebacksoon I had not seen either of those!!!! Very neat :oo I might have to start taking FFT3Ds of random 3d models now!
```ListDensityPlot3D@
RotateLeft[#,
Floor[Dimensions@#/2]] &@(CenterArray[
DiskMatrix3D[32], {256, 256, 256}] // Fourier // Abs)```

2 hours later…
12:58 PM
```ImageMesh[
RegionImage[
DiscretizeRegion[
ExampleData[{"Geometry3D", "StanfordBunny"}, "Region"]]]]```
I've encountered yet another wall of ineptitude. How can I get the `{0,1}` `Array` values out of a discretized (using this method) shape? I figure I would plop this in a `CenterArray` and run away with it, but this is not so. I have looked about the documentation and done a few searches in order to confirm I don't know what to do.
This'll be pretty sweet though!

1:29 PM
@CATrevillian Try `ImageData[Binarize[RegionImage[ExampleData[{"Geometry3D", "StanfordBunny"}, "Region"]]]]`.
(You don't need to apply `DiscretizeRegion[]` to an object that is already a `MeshRegion[]` object.)

2:22 PM
Aha! That makes a ton of sense now that you mention it. Thanks, @J.M.willbebacksoon !
```ListDensityPlot3D@
RotateLeft[#,
Floor[Dimensions@#/2]] &@(ImageData[
Binarize[
RegionImage[
ExampleData[{"Geometry3D", "StanfordBunny"}, "Region"]]]] //
Fourier // Abs)```
Whoops its actually
```ListDensityPlot3D@
RotateLeft[#,
Floor[Dimensions@#/2]] &@(CenterArray[
ImageData[
Binarize[
RegionImage[
ExampleData[{"Geometry3D", "StanfordBunny"},
"Region"]]]], {256, 256, 256}] // Fourier // Abs)```

5 hours later…
7:24 PM
What is "Expressions" here?
Plot[{Sin[x],Cos[x]},{x,0,2 Pi},PlotLabels->Callout["Expressions",Above]]

8:09 PM
@anhnha Look it up in the docs for `Plot`

@b3m2a1 okay.
What does {0,0.5} do in this Callout?
Plot[Callout[Sinc[x], "label", {5 Pi/2, {0, 0.5}}]]
Read the docs and plotted but still couldn't understand it

You can look that one up in the docs for `Callout`

@b3m2a1 well the one above is from the docs
that doesn't help

I know that!!!

8:20 PM
It states very clearly: `Possible callout positions pos vary by function, but typically include: {pos,epos}`

{a, {b,c}}
no form for this

First arg: `pos` second arg `epos`

I thought the first one is postion
for just x
and then the second one {b,c} is apos
what is epos?
they don't even explain what epos means

apos would be the 4th argument
If you're not sure, try different values
Test it out

already did that for 30 minutes
what is epos?
also plotted to see where {0,0.5}
but don't see any relation

8:27 PM
Try this:
```Plot[
{
Callout[Sinc[x], "label", {5 Pi/2, {0, 0.5}}],
Callout[Sinc[x], Style["label", Red], {5 Pi/2, {1, 0.5}}],
Callout[Sinc[x], Style["label", Pink], {5 Pi/2, {-1, -1}}]
},
{x, 0, 10},
PlotStyle -> ColorData[97][1]
]```
First arg: `x` position relative to `pos`
Second arg: `y` position relative to `pos`
The specifics of how they relate I haven't worked out yet, but clearly positive is left, negative is right
It's probably related to character widths and line widths rather than anything about the plot itself
Think about the arguments to `Text`. I bet they're just using those.
Mmm looks like they don't support negative values all that well

I don't think they even mention that in the docs.
What is "a" and "e" in apos and epos? I have no idea reading them.

Anchor and Expression

{pos,epos} epos in expr placed at position pos
epos = expr
then what does that say?
expr in expr placed at position pos

2 hours later…
10:12 PM
@anhnha Sigh you're taking the variable name too seriously. It's the position inside the `expr` placed at `pos`. Think of taking a big box around `"label"`. Then `epos` denotes a position inside that box. That point will then be placed at `pos` inside the main graphic.
It looks like there are some weird discontinuities at `0` (probably special cases where Mathematica is trying to be too helpful), but otherwise this model works.

10:30 PM
The docs isn't as good as I thought.
At least they should mention that.
Also what specific position inside the box?
Center?

1 hour later…
11:42 PM
@anhnha the one specified by `epos`