From 4cb9acd449b6c0e7bd22178d0a134a7323facd02 Mon Sep 17 00:00:00 2001 From: Paul McCarthy <pauld.mccarthy@gmail.com> Date: Wed, 19 Oct 2016 19:01:00 +0100 Subject: [PATCH] FSLDirDialog shows a little hint on OSX. Increased indexed gzip file readbuf size, despite profiling showing that it doesn't make much difference. --- fsl/data/image.py | 2 +- fsl/data/imagewrapper.py | 2 +- fsl/utils/dialog.py | 21 ++++++++++++++++++++- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/fsl/data/image.py b/fsl/data/image.py index 5dc297b92..755037cab 100644 --- a/fsl/data/image.py +++ b/fsl/data/image.py @@ -827,7 +827,7 @@ def loadIndexedImageFile(filename): fobj = igzip.SafeIndexedGzipFile( filename=filename, spacing=4194304, - readbuf_size=131072) + readbuf_size=1048576) fmap = nib.Nifti1Image.make_file_map() fmap['image'].fileobj = fobj diff --git a/fsl/data/imagewrapper.py b/fsl/data/imagewrapper.py index b05510d8a..2e7ab6ac6 100644 --- a/fsl/data/imagewrapper.py +++ b/fsl/data/imagewrapper.py @@ -12,7 +12,7 @@ Terminology ----------- -There are some confusing terms used in this module, so it may be of use to +There are some confusing terms used in this module, so it may be useful to get their definitions straight: - *Coverage*: The portion of an image that has been covered in the data diff --git a/fsl/utils/dialog.py b/fsl/utils/dialog.py index 3228ae612..274ca6873 100644 --- a/fsl/utils/dialog.py +++ b/fsl/utils/dialog.py @@ -22,6 +22,7 @@ import os import os.path as op import threading +import six import wx from .platform import platform as fslplatform @@ -671,7 +672,25 @@ class FSLDirDialog(wx.Dialog): self.__contentSizer.Add(self.__message, flag=wx.EXPAND, proportion=1) self.__contentSizer.Add((1, 20)) self.__contentSizer.Add(self.__buttonSizer, flag=wx.EXPAND) - + + # If running on OSX, add a message + # telling the user about the + # cmd+shift+g shortcut + if fslplatform.os == 'Darwin': + + self.__hint = wx.StaticText( + self, + label=six.u('Hint: Press \u2318+\u21e7+G in the file ' + 'dialog to manually type in a location.')) + + self.__hint.SetForegroundColour('#888888') + + self.__contentSizer.Insert(2, self.__hint, flag=wx.EXPAND) + self.__contentSizer.Insert(3, (1, 20)) + + else: + self.__hint = None + self.__mainSizer.Add(self.__icon, flag=wx.ALL | wx.CENTRE, border=20) -- GitLab