nipy / mindboggle

Automated anatomical brain label/shape analysis software (+ website)
http://mindboggle.info
Other
144 stars 54 forks source link

"cannot connect to X server :1" error when running mindboggle outside of Docker container #113

Closed binarybottle closed 7 years ago

binarybottle commented 7 years ago

I get an error when running the docker container as an executable (and scipy.ndimage.affine_transform() generates a warning) in the new version of mindboggle:

Executing node Vertex_table.a1 in dir: /home/jovyan/work/mindboggle123_output/mindboggled/mindboggling/arno/Mindboggle/_hemi_rh/Vertex_table Standard error: /opt/conda/lib/python3.5/site-packages/scipy/ndimage/interpolation.py:462: UserWarning: The behaviour of affine_transform with a one-dimensional array supplied for the matrix parameter has changed in scipy 0.18.0. "The behaviour of affine_transform with a one-dimensional " : cannot connect to X server :1 Return code: 1

satra commented 7 years ago

@binarybottle - can you point me to where you define the node?

satra commented 7 years ago

and the function itself that it calls.

binarybottle commented 7 years ago

Here is the line in convert2nii() that calls scipy.ndimage.affine_transform(): https://github.com/nipy/mindboggle/blob/master/mindboggle/mio/convert_volumes.py#L104

But the error seems to occur in a different place:

 > Executing node Vertex_table.a1 in dir: /home/jovyan/work/mindboggle123_output/mindboggled/mindboggling/arno/Mindboggle/_hemi_rh/Vertex_table

refers to the following node: https://github.com/nipy/mindboggle/blob/master/mindboggle/mindboggle#L1260

which calls the function write_vertex_measures(): https://github.com/nipy/mindboggle/blob/master/mindboggle/mio/tables.py#L407

which calls apply_affine_transforms(): https://github.com/nipy/mindboggle/blob/master/mindboggle/mio/vtks.py#L1371

satra commented 7 years ago

ah - i forgot about your vtk requirement. so in that case you need to have xvfbwrapper and xvfb as part of the container.

satra commented 7 years ago

can you check if those exist in the container already? if so, then the Node definition (or anything that uses vtk functions may need: node_variable.interface._redirect_x = True

also the nipype you are installing is still the older version. we are hoping to get conda-forge release fixed in the next day or two.

binarybottle commented 7 years ago

mindboggle-base installs xvfb but not xvfbwrapper -- That's probably why mindboggle runs successfully when you're inside the Docker container but not when you're outside the container! I will update this now, but why do you think all of the other vtk-related functions were able to run successfully?

binarybottle commented 7 years ago

Even after rebuilding the container with xvfb and xvfbwrapper I got the same error.

Should I put Transform_surface_points.interface._redirect_x = True here?: https://github.com/nipy/mindboggle/blob/master/mindboggle/mindboggle#L1331

(or would it be TransformPoints?)

satra commented 7 years ago

it should be the node variable not node name. you can try this first to see if it helps.

binarybottle commented 7 years ago

I will try this now. Just confirmed that mindboggle123 runs fine within the docker container, just not from the outside...

satra commented 7 years ago

what do you mean by "just not from outside"?

binarybottle commented 7 years ago

It fails when I run the Docker container as an executable: sudo docker run --rm -ti -v $HOST:$DOCK nipy/mindboggle $IMAGE --id $ID but not when I run mindboggle within the container: sudo docker run --rm -ti -v $HOST:$DOCK --entrypoint /bin/bash nipy/mindboggle

satra commented 7 years ago

@binarybottle - that's very weird. don't know why that would happen.

binarybottle commented 7 years ago

Fixed by pull request #115.