Rank: 85 based on 409 downloads (last 30 days) and 12 files submitted
photo

Sven

E-mail
Company/University
University of Michigan

Personal Profile:

Aussie living in the US. Engineering with MATLAB.

Some Interests:
-3D Volume Processing (CT, mri)
-Finite Element Analysis (human body simulation)
-Geometry Analysis (human body morphomics)

Professional Interests:
Image processing, Finite Element Analysis, Human Body Biomechanics

 

Watch this Author's files

 

Files Posted by Sven View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
31 Jul 2013 Screenshot surf2solid - make a solid volume from a surface for 3D printing Turns thin surfaces into closed solids by adding a flat base or offsetting by a given thickness. Author: Sven stl, patch, mesh, solid, surface, 3d 29 2
  • 5.0
5.0 | 2 ratings
26 Jul 2013 Screenshot inpolyhedron - are points inside a volume? It's inpolygon(), but for 3D triangulated surfaces. (non-convex surfaces, too!) Author: Sven inpolygon, triangles, mesh, patch, inside, stl 63 16
  • 4.2
4.2 | 5 ratings
16 Jul 2013 Screenshot upsert - automatically handles database inserts/updates If a data row already exists, UPDATE that row! If it doesn't exist, INSERT that row! Author: Sven database, insert, update 15 3
  • 4.0
4.0 | 1 rating
23 Apr 2013 Screenshot Fast morphological reconstruction of large logical masks. MATLAB's imreconstruct is slow for large 3D logical masks. bwreconstruct is a faster replacement. Author: Sven imreconstruct, bwselect, logical, reconstruction 9 0
11 Apr 2013 Screenshot stlwrite - Write binary or ascii STL file Export a variety of inputs (patch, surface) to an STL triangular mesh Author: Sven stl, tri, patch, mesh, data import, data export 158 25
  • 4.9
4.9 | 11 ratings
Comments and Ratings by Sven View all
Updated File Comments Rating
30 Jul 2013 GUI Layout Toolbox Layout management objects for MATLAB GUIs Author: Ben Tordoff

@Ben: Thanks for the clarification. The ability to span multiple grid entries would be quite useful. The syntax to define it on the other hand... I agree - messy. I've never quite felt comfortable with the Grid.Children usage (like rearranging children into a specific order different to columns-first-left-to-right). I'd welcome a revisit and would be happy to give feedback.

30 Jul 2013 GUI Layout Toolbox Layout management objects for MATLAB GUIs Author: Ben Tordoff

@Beat:

I think that you've hit a missing functionality with Container.getpixelposition. It hasn't yet got a recursive implementation (whereas regular MATLAB ui components do, and some java components call the recursive version). You can possibly get by by replacing that function with what I've got below but I've still had an issue or two. Ben, David - does this seem reasonable?

function pos = getpixelposition( obj, recursive )
%getpixelposition get the absolute pixel position
%
% POS = GETPIXELPOSITION(C) gets the absolute position of the container C
% within its parent window. The returned position is in pixels.
pos = getpixelposition( obj.UIContainer );

if nargin<2
recursive = false;
end
if recursive && ~ishghandle(obj.Parent,'figure')
parentPos = getpixelposition(obj.Parent, recursive);
pos = pos + [parentPos(1) parentPos(2) 0 0] - [1 1 0 0];
end
end % getpixelposition

29 Jul 2013 GUI Layout Toolbox Layout management objects for MATLAB GUIs Author: Ben Tordoff

Ben, David,

The "icon" for uiextras.Grid makes it look like you can define a grid, and have one axis span multiple entries on that grid. I don't think, however, that this is actually possible.

An analogy would be calls to subplot like below:

figure, subplot(2,2,[1 3]), peaks
subplot(2,2,2), peaks
subplot(2,2,4), peaks

So, is it possible to make a grid like the following:

figure, G = uiextras.Grid('Parent',gcf);
B13 = uicontrol('Parent', G, 'String','Button Spanning [1 3]');
B2 = uicontrol('Parent', G, 'String','Button in spot 2');
B4 = uicontrol('Parent', G, 'String','Button in spot 4');
set(G,'RowSizes',[-1 -1])

... and then actually make the first button span two rows?

15 Jul 2013 upsert - automatically handles database inserts/updates If a data row already exists, UPDATE that row! If it doesn't exist, INSERT that row! Author: Sven

Marcus/Harish, here's a fully worked example:

--- ORACLE SCRIPT ---
DROP TABLE TMP_TABLE CASCADE CONSTRAINTS;
CREATE TABLE TMP_TABLE
(
COL1 NUMBER,
COL2 DATE
);
Insert into TMP_TABLE Values (1, DATE '2013-05-15');
Insert into TMP_TABLE Values (2, DATE '2013-01-01');
Insert into TMP_TABLE Values (3, DATE '2013-01-01');
Insert into TMP_TABLE Values (4, DATE '2013-10-25');
commit work;

--- MATLAB ---

>> D = fetch(conn,'select * from tmp_table')
D =
[1] '2013-05-15 00:00:00.0'
[2] '2013-01-01 00:00:00.0'
[3] '2013-01-01 00:00:00.0'
[4] '2013-10-25 00:00:00.0'

>> newData = {5 '2014-02-07'; 99 '2013-01-01'}
newData =
[ 5] '2014-02-07'
[99] '2013-01-01'

>> upsert(conn, 'tmp_table', {'col1','col2'}, 'col2', newData, 'dateFields', 'col2')

ans =
1
0

>> D = fetch(conn,'select * from tmp_table')
D =
[ 5] '2014-02-07 00:00:00.0'
[ 1] '2013-05-15 00:00:00.0'
[99] '2013-01-01 00:00:00.0'
[99] '2013-01-01 00:00:00.0'
[ 4] '2013-10-25 00:00:00.0'

You see above that the 2014-02-07 date was new, so it was added. The 2013-01-01 date matched two rows, so they were both updated.

Note that I just found a typo in the first file I uploaded with date functionality... it would have failed if newData contained more than 1 row... there's a new one (with a one-character typo changed!) in submission now.

04 Jul 2013 stlwrite - Write binary or ascii STL file This is an update to the excellent work done by Sven Holcombe to add color support Author: Grant Lohsen

Hi Chris, just a note that the stlwrite on which this file is based has facecolor implemented properly.

Comments and Ratings on Sven's Files View all
Updated File Comment by Comments Rating
30 Jul 2013 surf2solid - make a solid volume from a surface for 3D printing Turns thin surfaces into closed solids by adding a flat base or offsetting by a given thickness. Author: Sven Kassebaum, Paul

Love it!

30 Jul 2013 surf2solid - make a solid volume from a surface for 3D printing Turns thin surfaces into closed solids by adding a flat base or offsetting by a given thickness. Author: Sven mathgirl

The function is amazing. It works fast and efficiently, and is very easy to use. The resulting stl has high resolution and reasonable size.

Thank you Sven!
Really appreciate your work.

15 Jul 2013 upsert - automatically handles database inserts/updates If a data row already exists, UPDATE that row! If it doesn't exist, INSERT that row! Author: Sven Sven

Marcus/Harish, here's a fully worked example:

--- ORACLE SCRIPT ---
DROP TABLE TMP_TABLE CASCADE CONSTRAINTS;
CREATE TABLE TMP_TABLE
(
COL1 NUMBER,
COL2 DATE
);
Insert into TMP_TABLE Values (1, DATE '2013-05-15');
Insert into TMP_TABLE Values (2, DATE '2013-01-01');
Insert into TMP_TABLE Values (3, DATE '2013-01-01');
Insert into TMP_TABLE Values (4, DATE '2013-10-25');
commit work;

--- MATLAB ---

>> D = fetch(conn,'select * from tmp_table')
D =
[1] '2013-05-15 00:00:00.0'
[2] '2013-01-01 00:00:00.0'
[3] '2013-01-01 00:00:00.0'
[4] '2013-10-25 00:00:00.0'

>> newData = {5 '2014-02-07'; 99 '2013-01-01'}
newData =
[ 5] '2014-02-07'
[99] '2013-01-01'

>> upsert(conn, 'tmp_table', {'col1','col2'}, 'col2', newData, 'dateFields', 'col2')

ans =
1
0

>> D = fetch(conn,'select * from tmp_table')
D =
[ 5] '2014-02-07 00:00:00.0'
[ 1] '2013-05-15 00:00:00.0'
[99] '2013-01-01 00:00:00.0'
[99] '2013-01-01 00:00:00.0'
[ 4] '2013-10-25 00:00:00.0'

You see above that the 2014-02-07 date was new, so it was added. The 2013-01-01 date matched two rows, so they were both updated.

Note that I just found a typo in the first file I uploaded with date functionality... it would have failed if newData contained more than 1 row... there's a new one (with a one-character typo changed!) in submission now.

14 Jul 2013 upsert - automatically handles database inserts/updates If a data row already exists, UPDATE that row! If it doesn't exist, INSERT that row! Author: Sven Marcus

Possible to include an example of how to use the newly added Date type fields in primary key? I have difficulty figuring out how to use it :(

12 Jul 2013 deploypcode - recursively pcode files with help attached DEPLOYPCODE recursively searches a directory for .m files, creating encrypted .p files with .m help Author: Sven Pete

Excellent. When flattenFileTree == false, it works like a charm. Good work, many thanks!

Top Tags Applied by Sven
stl, mesh, patch, volume, 3d
Files Tagged by Sven View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
31 Jul 2013 Screenshot surf2solid - make a solid volume from a surface for 3D printing Turns thin surfaces into closed solids by adding a flat base or offsetting by a given thickness. Author: Sven stl, patch, mesh, solid, surface, 3d 29 2
  • 5.0
5.0 | 2 ratings
26 Jul 2013 Screenshot inpolyhedron - are points inside a volume? It's inpolygon(), but for 3D triangulated surfaces. (non-convex surfaces, too!) Author: Sven inpolygon, triangles, mesh, patch, inside, stl 63 16
  • 4.2
4.2 | 5 ratings
16 Jul 2013 Screenshot upsert - automatically handles database inserts/updates If a data row already exists, UPDATE that row! If it doesn't exist, INSERT that row! Author: Sven database, insert, update 15 3
  • 4.0
4.0 | 1 rating
23 Apr 2013 Screenshot Fast morphological reconstruction of large logical masks. MATLAB's imreconstruct is slow for large 3D logical masks. bwreconstruct is a faster replacement. Author: Sven imreconstruct, bwselect, logical, reconstruction 9 0
11 Apr 2013 Screenshot stlwrite - Write binary or ascii STL file Export a variety of inputs (patch, surface) to an STL triangular mesh Author: Sven stl, tri, patch, mesh, data import, data export 158 25
  • 4.9
4.9 | 11 ratings

Contact us