示例#1
0
    def create_settings(self):
        self.workspace = None
        module_explanation = [
            "To begin creating your project, use the %s module to compile" %
            self.module_name,
            "a list of files and/or folders that you want to analyze. You can also specify a set of rules",
            "to include only the desired files in your selected folders."
        ]
        self.set_notes([" ".join(module_explanation)])

        self.path_list_display = cps.PathListDisplay()
        predicates = [
            FilePredicate(),
            DirectoryPredicate(),
            ExtensionPredicate()
        ]

        self.filter_choice = cps.Choice("Filter images?",
                                        FILTER_CHOICE_ALL,
                                        value=FILTER_CHOICE_IMAGES,
                                        doc="""
            The <b>Images</b> module will pass all the files specified in the file list
            panel downstream to have a meaningful name assigned to it (so other modules can
            access it) or optionally, to define the relationships between images and associated
            metadata. Enabling file filtering will allow you to specify a subset of the files
            from the file list panel by defining rules to filter the files. This approach is
            useful if, for example, you drag-and-dropped a folder onto the file list panel
            which contains a mixture of images that you want to analyze and other files that
            you want to ignore.
            <p>Several options are available for this setting:
            <ul>
            <li><i>%(FILTER_CHOICE_NONE)s:</i> Do not enable filtering; all files in the File list
            panel will be passed to downstream modules for processing. This option can be
            selected if you are sure that only images are specified in the list.</li>
            <li><i>%(FILTER_CHOICE_IMAGES)s:</i> Only image files will be passed to downstream
            modules. The permissible image formats are provided by a library called Bio-Formats; see
            <a href="http://www.openmicroscopy.org/site/support/bio-formats5/supported-formats.html">here</a> for the formats available.</li>
            <li><i>%(FILTER_CHOICE_CUSTOM)s:</i> Specify custom rules for selecting a subset of
            the files from the File list panel. This approach is useful if, for example, you
            drag-and-dropped a folder onto the File list panel which contains a mixture of images
            that you want to analyze and other files that you want to ignore.</li>
            </ul></p>""" % globals())

        self.filter = cps.Filter("Select the rule criteria",
                                 predicates,
                                 FILTER_DEFAULT,
                                 doc="""
            Specify a set of rules to narrow down the files to be analyzed.
            <p>%(FILTER_RULES_BUTTONS_HELP)s</p>""" % globals())

        self.update_button = cps.PathListRefreshButton(
            "",
            "Apply filters to the file list",
            doc="""
            <i>(Only displayed if filtering based on rules)</i><br>
            Re-display the file list, removing or graying out the files
            that do not pass the current filter.
            """)
示例#2
0
    def create_settings(self):
        self.workspace = None
        module_explanation = [
            "To begin creating your project, use the %s module to compile" %
            self.module_name,
            "a list of files and/or folders that you want to analyze. You can also specify a set of rules",
            "to include only the desired files in your selected folders."
        ]
        self.set_notes([" ".join(module_explanation)])

        self.path_list_display = cps.PathListDisplay()
        predicates = [
            FilePredicate(),
            DirectoryPredicate(),
            ExtensionPredicate()
        ]

        self.wants_filter = cps.Binary(
            "Filter images based on matching rules?",
            True,
            doc="""
            Check this setting to display and use rules to filter files for processing. 
            <p>By default, <b>Images</b> will pass all the files specified in the file list
            panel downstream to have a meaningful name assigned to it (so other modules can access it) or optionally, to 
            define the relationships between images and associated metadata. Selecting this option will allow you to specify
            a subset of the files from the file list panel by defining rules to filter the files. This 
            approach is useful if, for example, you drag-and-dropped a folder onto the file list panel 
            which contains a mixture of images that you want to analyze and other files that you want to ignore.</p>"""
        )

        self.filter = cps.Filter(
            "Select the rule criteria",
            predicates,
            'and (extension does isimage) (directory doesnot startwith ".")',
            doc="""
            Specify a set of rules to narrow down the files to be analyzed. 
            <p>%(FILTER_RULES_BUTTONS_HELP)s</p>""" % globals())

        self.update_button = cps.PathListRefreshButton(
            "",
            "Apply filters to the file list",
            doc="""
            <i>(Only displayed if filtering based on rules)</i><br>
            Re-display the file list, removing or graying out the files
            that do not pass the current filter.
            """)