void Export(int dim, int pos) {
       ImagePlus myim=null;
       if (dim >= 0)
       {
           if (colormode)
                myim=getDisplayedSlice(dim,pos).ColorExport();
           else
                myim=getDisplayedSlice(dim,pos).Export();
       }
       else
       {
           if (ActElement() instanceof ByteElement)
                myim=NewImage.createByteImage("View5D Volume",SizeX,SizeY,SizeZ,NewImage.FILL_BLACK);
           if (ActElement() instanceof ShortElement)
                myim=NewImage.createShortImage("View5D Volume",SizeX,SizeY,SizeZ,NewImage.FILL_BLACK);
           if (ActElement() instanceof IntegerElement)
                myim=NewImage.createShortImage("View5D Volume",SizeX,SizeY,SizeZ,NewImage.FILL_BLACK);
           if (ActElement() instanceof FloatElement)
                myim=NewImage.createFloatImage("View5D Volume",SizeX,SizeY,SizeZ,NewImage.FILL_BLACK);
           if (ActElement() instanceof DoubleElement)
                myim=NewImage.createFloatImage("View5D Volume",SizeX,SizeY,SizeZ,NewImage.FILL_BLACK);

           for (int i=0;i<SizeZ;i++)
           {
                ActElement().CopySliceToSimilar(i,myim.getImageStack().getPixels(i+1));
           }
       }
       SetMinMaxCalib(myim,dim);
       myim.show();
       myim.updateAndDraw();
   }