Opened 12 years ago

Closed 12 years ago

#182 closed defect (fixed)

Can't import RGB image as slice of 3D object

Reported by: mackoel@… Owned by: Alireza
Priority: major Milestone: 8.4
Component: rasserver Version: 8.3
Keywords: Cc: Peter Baumann
Complexity: Medium

Description

Create collection for 3D RGB object:

rasql —user rasadmin —passwd rasadmin -s localhost -q 'create collection img_3d RGBSet3'

Insert an empty object:

rasql —user rasadmin —passwd rasadmin -s localhost -q
'insert into img_3d values marray m in [0:0,0:0,0:0] values struct{0c,0c,0c}'

rasql —user rasadmin —passwd rasadmin -s localhost -q 'update img_3d as s set s[2047:2047,1215:1215,133:133] assign marray m in [2047:2047,1215:1215,133:133] values struct{0c,0c,0c}'

Try to update the slice:

rasql —user rasadmin —passwd rasadmin -s localhost -q
'update img_3d as v set v[0:2047,0:1215,0] assign inv_tiff( $1 )'
—file img_3d_slice.tif —mddtype RGBImage —mdddomain [0:2047,0:1215]

rasql: rasdaman query tool v1.0, rasdaman v8 — generated on 20.07.2012
16:23:52. opening database RASBASE at localhost:7001...ok
fetching type information for RGBImage from database, using readonly
transaction…ok reading file img_3d_slice.tif…ok

constant 1: GMarray
Oid……………….:
Type Structure……..:
Type Schema………..: marray< struct{ char red, char green, char

blue } > Domain…………….: [0:2047,0:1215]

Base Type Schema……: struct{ char red, char green, char blue }
Base Type Length……: 3
Data format………. : Array
Data size (bytes)…. : 7471104

Executing update query…Segmentation fault

rasql —user rasadmin —passwd rasadmin -s localhost -q
'update img_3d as v set v[0:2047,0:1215,0] assign inv_tiff( $1 )'
—file img_3d_slice.tif

rasql: rasdaman query tool v1.0, rasdaman v8 — generated on 20.07.2012
16:23:52. opening database RASBASE at localhost:7001...ok
fetching type information for GreyString from database, using readonly
transaction…ok reading file img_3d_slice.tif…ok

constant 1: GMarray
Oid……………….:
Type Structure……..:
Type Schema………..: marray< char >
Domain…………….: [0:3796741]
Base Type Schema……: char
Base Type Length……: 1
Data format………. : Array
Data size (bytes)…. : 3796742

Executing update query…rasdaman error 952: Update error 952 in line
1, column 1, near token update: Update base type does not match MDD
base type. aborting transaction…ok rasql done.

Attachments (4)

img_3d_slice.tif (3.6 MB ) - added by mackoel@… 12 years ago.
grey_slice_0.bmp.unknown (2.2 MB ) - added by mackoel@… 12 years ago.
grey_slice_1.bmp.unknown (1.6 MB ) - added by mackoel@… 12 years ago.
gimg_3d_slice.bmp (3.6 MB ) - added by mackoel@… 12 years ago.

Change History (9)

by mackoel@…, 12 years ago

Attachment: img_3d_slice.tif added

comment:1 by Alireza, 12 years ago

Owner: set to Alireza
Status: newassigned

comment:2 by Alireza, 12 years ago

Cc: Peter Baumann added

by mackoel@…, 12 years ago

Attachment: grey_slice_0.bmp.unknown added

by mackoel@…, 12 years ago

Attachment: grey_slice_1.bmp.unknown added

by mackoel@…, 12 years ago

Attachment: gimg_3d_slice.bmp added

comment:3 by Dimitar Misev, 12 years ago

Alireza, can I just suggest to also try to insert this image in a 2D collection. It's possible that the tiff converter has problems reading it or something similar, so it doesn't hurt to make sure that it works for 2D.

comment:4 by Dimitar Misev, 12 years ago

So we discovered the error is specific to --mddtype RGBImage --mdddomain [0:2047,0:1215], not whether it's 2D/3D.

The ultimate solution is to fix ticket #119 probably, but fixing the segfault when using these options should be also done.

comment:5 by Dimitar Misev, 12 years ago

Resolution: fixed
Status: assignedclosed

I found a workaround, casting to char seems to work ok, even though technically it should be casted to RGBPixel, which doesn't work at the moment (#119). So this works:

rasql -q 'update test as v set v[0:2047,0:1215,0] assign (char) inv_tiff( $1 )' --file img_3d_slice.tif 
Note: See TracTickets for help on using tickets.