Пример #1
0
    def _run(self, protocol, request):

        if not protocol.useSplitVolume:
            emptyInput = protocol.inputVolume.pointsNone()
        else:
            emptyInput = (protocol.volumeHalf1.pointsNone()
                          or protocol.volumeHalf2.pointsNone())

        if emptyInput:
            return HttpResponse("Error: select the input volume(s) first.")
        else:
            plotUrl, min_ang = getPlotResMap(request, protocol)

            ang = protocol.prewhitenAng.get()
            if ang < min_ang:
                ang = min_ang

            context = {
                # Params
                'ang': round(ang, 2),
                'ramp': protocol.prewhitenRamp.get(),
                # Extra Params
                'pValue': protocol.pVal.get(),
                'minRes': protocol.minRes.get(),
                'maxRes': protocol.maxRes.get(),
                'stepRes': protocol.stepRes.get(),
                # Others
                'plot': plotUrl,
                'min_ang': round(min_ang, 2),
                'messi_js': getResourceJs('messi'),
                'messi_css': getResourceCss('messi'),
            }

            if protocol.useSplitVolume:
                context.update({
                    'useSplit': 1,
                    'inputId': protocol.volumeHalf1.getUniqueId(),
                    'splitId': protocol.volumeHalf2.getUniqueId()
                })
            else:
                context.update({'inputId': protocol.inputVolume.getUniqueId()})

            if protocol.applyMask:
                if protocol.maskVolume.pointsNone():
                    return HttpResponse("Error: select the input mask first.")
                context.update({
                    'useMask': 1,
                    'maskId': protocol.maskVolume.getUniqueId()
                })

            context = base_wiz(request, context)
            return render_to_response('wizards/wiz_resmap.html', context)
Пример #2
0
def service_movies(request):

    if 'projectName' in request.session: request.session['projectName'] = ""
    if 'projectPath' in request.session: request.session['projectPath'] = ""

    movies_utils = join(django_settings.STATIC_URL, "js/", "movies_utils.js")

    context = {'projects_css': getResourceCss('projects'),
               'project_utils_js': getResourceJs('project_utils'),
               'scipion_mail': getResourceIcon('scipion_mail'),
               'movies_utils': movies_utils,
               }
    
    context = base_grid(request, context)
    return render_to_response('movies_projects.html', context)
Пример #3
0
def service_movies(request):

    if 'projectName' in request.session: request.session['projectName'] = ""
    if 'projectPath' in request.session: request.session['projectPath'] = ""

    movies_utils = join(django_settings.STATIC_URL, "js/", "movies_utils.js")

    context = {
        'projects_css': getResourceCss('projects'),
        'project_utils_js': getResourceJs('project_utils'),
        'scipion_mail': getResourceIcon('scipion_mail'),
        'movies_utils': movies_utils,
    }

    context = base_grid(request, context)
    return render_to_response('movies_projects.html', context)
Пример #4
0
def resmap_projects(request):
   
    if 'projectName' in request.session: request.session['projectName'] = ""
    if 'projectPath' in request.session: request.session['projectPath'] = ""

    myresmap_utils = join(django_settings.STATIC_URL, "js/", "myresmap_utils.js")

    context = {'projects_css': getResourceCss('projects'),
               'project_utils_js': getResourceJs('project_utils'),
               'scipion_mail': getResourceIcon('scipion_mail'),
               'myresmap_utils': myresmap_utils,
               'hiddenTreeProt': True,
               }
    
    context = base_grid(request, context)
    return render_to_response('resmap_projects.html', context)
Пример #5
0
def resmap_projects(request):
   
    if 'projectName' in request.session: request.session['projectName'] = ""
    if 'projectPath' in request.session: request.session['projectPath'] = ""

    myresmap_utils = join(django_settings.STATIC_URL, "js/", "myresmap_utils.js")

    context = {'projects_css': getResourceCss('projects'),
               'project_utils_js': getResourceJs('project_utils'),
               'scipion_mail': getResourceIcon('scipion_mail'),
               'myresmap_utils': myresmap_utils,
               'hiddenTreeProt': True,
               }
    
    context = base_grid(request, context)
    return render_to_response('resmap_projects.html', context)
Пример #6
0
def create_context_chimera(volPath, threshold=None):
    # Control the threshold value
    if threshold == None:
        threshold = 0.1
    else:
        threshold = round(threshold, 3)
    
    chimeraHtml = chimera_headless(volPath, threshold)
    
    context = {"chimeraHtml": chimeraHtml,
               "volPath": volPath, 
               "threshold": threshold, 
               "jquery_ui_css": getResourceCss("jquery_ui"),
               "philogl": getResourceJs("philogl"),
               }
    
    return context
Пример #7
0
def create_context_chimera(volPath, threshold=None):
    # Control the threshold value
    if threshold == None:
        threshold = 0.1
    else:
        threshold = round(threshold, 3)
    
    chimeraHtml = chimera_headless(volPath, threshold)
    
    context = {"chimeraHtml": chimeraHtml,
               "volPath": volPath, 
               "threshold": threshold, 
               "jquery_ui_css": getResourceCss("jquery_ui"),
               "philogl": getResourceJs("philogl"),
               }
    
    return context
Пример #8
0
def service_movies(request):
    if CTX_PROJECT_NAME in request.session:
        request.session[CTX_PROJECT_NAME] = ""
    if CTX_PROJECT_PATH in request.session:
        request.session[CTX_PROJECT_PATH] = ""

    movies_utils = getResource("js/movies_utils.js")

    context = {
        'projects_css': getResourceCss('projects'),
        'project_utils_js': getResourceJs('project_utils'),
        'scipion_mail': getResourceIcon('scipion_mail'),
        'movies_utils': movies_utils,
    }

    context = base_grid(request, context)
    return render_to_response('movies_projects.html', context)
Пример #9
0
def service_projects(request):
   
    if CTX_PROJECT_NAME in request.session: request.session[CTX_PROJECT_NAME] = ""
    if CTX_PROJECT_PATH in request.session: request.session[CTX_PROJECT_PATH] = ""

    myfirstmap_utils = getResource("js/myfirstmap_utils.js")

    context = {'projects_css': getResourceCss('projects'),
               'project_utils_js': getResourceJs('project_utils'),
               'scipion_mail': getResourceIcon('scipion_mail'),
               'myfirstmap_utils': myfirstmap_utils,
               'hiddenTreeProt': True,
               SERVICE_NAME: MYFIRSTMAP_SERVICE
               }
    
    context = base_grid(request, context)
    return render_to_response('service_projects.html', context)
Пример #10
0
def particleValidation_projects(request):
    if CTX_PROJECT_NAME in request.session:
        request.session[CTX_PROJECT_NAME] = ""
    if CTX_PROJECT_PATH in request.session:
        request.session[CTX_PROJECT_PATH] = ""

    mypval_utils = getResource("js/mypval_utils.js")

    context = {
        'projects_css': getResourceCss('projects'),
        'project_utils_js': getResourceJs('project_utils'),
        'scipion_mail': getResourceIcon('scipion_mail'),
        'mypval_utils': mypval_utils,
        'hiddenTreeProt': True,
    }

    context = base_grid(request, context)
    return render_to_response('pval_projects.html', context)
Пример #11
0
def create_context_volume(request, inputParams, volPath, param_stats):
    import os

    context = None

    if inputParams[sj.MODE] == sj.MODE_VOL_NGL:

        # We need to convert the map to a valid NGL density format (mrc)
        volPath = volumeToNGL(volPath)

        context = {"ngl": getResourceJs('ngl'),
                   "volPath": volPath,
                   "threshold": 1.5,
                   'minSigma': 0,
                   'maxSigma': 4,
                   "jquery_ui_css": getResourceCss("jquery_ui")
        }

    return context
Пример #12
0
    def _run(self, protocol, request):
        
        if not protocol.inputVolume.get().hasValue():
            return HttpResponse("errorInput")
        elif protocol.useSplitVolume == True:
            if not protocol.splitVolume.get().hasValue():
                return HttpResponse("errorInput")
        else:
            plotUrl, min_ang = getPlotResMap(request, protocol)

            ang = protocol.prewhitenAng.get()
            if ang < min_ang:
                ang = min_ang
            
            context = {
                       # Params
                       'inputId': protocol.inputVolume.get().getObjId(),
                       'ang': round(ang, 2),
                       'ramp': protocol.prewhitenRamp.get(),
                       # Extra Params
                       'pValue': protocol.pVal.get(),
                       'minRes': protocol.minRes.get(), 
                       'maxRes': protocol.maxRes.get(),
                       'stepRes': protocol.stepRes.get(),
                       # Others
                       'plot': plotUrl,
                       'min_ang': round(min_ang, 2),
                       'messi_js': getResourceJs('messi'),
                       'messi_css': getResourceCss('messi'),
                       }
            
            if protocol.useSplitVolume == True and protocol.splitVolume.get().hasValue():
                context.update({'useSplit' : 1,
                                'splitId' : protocol.splitVolume.getObjId(),
                                })
           
            if protocol.applyMask == True and protocol.maskVolume.get().hasValue():
                context.update({'useMask' : 1,
                                'maskId' : protocol.maskVolume.getObjId(),
                                }) 
            
            context = base_wiz(request, context)
            return render_to_response('wizards/wiz_resmap.html', context)
Пример #13
0
    def _run(self, protocol, request):
        
        if not protocol.inputVolume.get().hasValue():
            return HttpResponse("errorInput")
        elif protocol.useSplitVolume == True:
            if not protocol.splitVolume.get().hasValue():
                return HttpResponse("errorInput")
        else:
            plotUrl, min_ang = getPlotResMap(request, protocol)

            ang = protocol.prewhitenAng.get()
            if ang < min_ang:
                ang = min_ang
            
            context = {
                       # Params
                       'inputId': protocol.inputVolume.get().getObjId(),
                       'ang': round(ang, 2),
                       'ramp': protocol.prewhitenRamp.get(),
                       # Extra Params
                       'pValue': protocol.pVal.get(),
                       'minRes': protocol.minRes.get(), 
                       'maxRes': protocol.maxRes.get(),
                       'stepRes': protocol.stepRes.get(),
                       # Others
                       'plot': plotUrl,
                       'min_ang': round(min_ang, 2),
                       'messi_js': getResourceJs('messi'),
                       'messi_css': getResourceCss('messi'),
                       }
            
            if protocol.useSplitVolume == True and protocol.splitVolume.get().hasValue():
                context.update({'useSplit' : 1,
                                'splitId' : protocol.splitVolume.getObjId(),
                                })
           
            if protocol.applyMask == True and protocol.maskVolume.get().hasValue():
                context.update({'useMask' : 1,
                                'maskId' : protocol.maskVolume.getObjId(),
                                }) 
            
            context = base_wiz(request, context)
            return render_to_response('wizards/wiz_resmap.html', context)