What about embedding in C++ application ?

]]>I suggest you subscribe to the Julia mailing list to get answers to your questions. I have seen discussions there about an image library, for example.

]]>Julia seems promised, especially its MATLAB like syntax.

I didn’t find answers on the following 2 questions:

1. How Julia can be embedded in C++ application (not via TCP/IP connection) ?

2. Are there plans to add image processing library (similar to MATLAB) to Julia ?

Thanks,

Vladimir ]]>

“It seems natural to me that a plane extracted from volumetric data should be a 2-d array, but maybe if I decide that should be a 3-d array of “thickness” 1, everything will be easy.” Both concepts do really describe the same thing, right? Isn’t it rather an insufficient function design, if it consists of a 2d arrays and refuses a “3d slice of thickness 1”?

]]>For my use (statistics, time series, finance), I use the elementwise operators much more frequently than I use matrix operators. I often have 3D time series of matrices that I want to slice either longitudinally or laterally. Elementwise can also apply in a natural way to higher-dimension arrays.

I want to like Julia, since I really want a modern-feeling type-inferenced language to do numerics in, but the array slicing feels like a step backwards from NumPy.

]]>I like the idea of nested brackets and a[1,:] vs. a[1:1,:].

]]>Thanks for your comments! Some replies:

1) permute is indeed one solution:

transpose(A::AbstractArray) = permute(A::AbstractArray, ndims(A):-1:1)

2) I should have said “with a single index and : everywhere else” (as my examples illustrate).

3) That’s not quite what I want. What I want is the same as `reshape(a[1, :], size(a)[2:])`

but without having to do the shape computation myself.

4) I am looking for something compact that I could type as a function argument on the command line. In NumPy, it’s the nesting level of the brackets that sets the number of dimensions, so it’s trivial to write arrays of any rank.

5) sum(A, 2) looks good. It led me to discover Region and Dims, now I just have to figure out how they work exactly.

6) I did use `resize()`

but found my code littered with it to the point of becoming unreadable. I suspect it’s no good for performance either but I didn’t measure. `squeeze()`

is of no use for me. I don’t want to flatten all dimensions of length 1, but just a specific one.

I agree it is sometimes useful to keep the original array dimension, but sometimes it isn’t. NumPy offers both with a simple notation, and Julia could follow the same idea: `a[1, :]`

would have one dimension less than a and `a[1:1, :]`

would have the same rank as a.

7) I don’t think of my volumetric data as images as I use it mostly as a function of space sampled at discrete grid points. But I’ll have a look at your image library, thanks for the pointer!

]]>2. “Indexing a 2-d array with a single index yields a 2-d array. Indexing with two indices yields a scalar.” Indexing any array with a single index yields a scalar, not an array.

3. “How do I extract a 1d array?” c = Int32[a[1,2]]

4. “How do I write a 3d array literal?” There may be other solutions, but (a) the “comprehension” syntax you already demonstrated covers many use cases, and (b) there’s always:

A = Array(Int,2,2,2)

A[:,:,1] = [1 2; 3 4]

A[:,:,2] = [5 6; 7 8]

Not sure you’d count this as sufficiently convenient; how does it work in other languages?

One important point is that with Julia, the distinction between “built-in” and “not built in” is blurry. For example, you can define (with very little effort) your own types that can be accorded the same status as Int32. This is quite different from many other languages. So, you could presumably define whatever syntax for this operation you want.

5. “Then how do I do a sum over all the rows?” sum(A,2)

6. “It seems natural to me that a plane extracted from volumetric data should be a 2-d array, but maybe if I decide that should be a 3-d array of “thickness” 1, everything will be easy.” Try “squeeze” and “reshape”. There are applications where it’s really nice to slice but still keep track of the original array dimensions, so I personally am quite happy with this design decision in Julia.

7. Given your interests in volumetric data sets over time, perhaps you might want to participate in the work going on in the Image library:

git@github.com:timholy/julia.git ]]>