Opened 5 years ago

Closed 5 years ago

#182 closed defect (fixed)

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

Reported by: mackoel@… Owned by: arezaeim
Priority: major Milestone: 8.4
Component: rasserver Version: 8.3
Keywords: Cc: pbaumann
Complexity:

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@… 5 years ago.
grey_slice_0.bmp.unknown (2.2 MB) - added by mackoel@… 5 years ago.
grey_slice_1.bmp.unknown (1.6 MB) - added by mackoel@… 5 years ago.
gimg_3d_slice.bmp (3.6 MB) - added by mackoel@… 5 years ago.

Change History (9)

Changed 5 years ago by mackoel@…

comment:1 Changed 5 years ago by arezaeim

  • Owner set to arezaeim
  • Status changed from new to assigned

comment:2 Changed 5 years ago by arezaeim

  • Cc pbaumann added

Changed 5 years ago by mackoel@…

Changed 5 years ago by mackoel@…

Changed 5 years ago by mackoel@…

comment:3 Changed 5 years ago by dmisev

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 Changed 5 years ago by dmisev

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 Changed 5 years ago by dmisev

  • Resolution set to fixed
  • Status changed from assigned to closed

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.