Ignore:
Timestamp:
Sep 27, 2013 4:59:01 PM (9 years ago)
Author:
srkline
Message:

Better colorization of Gizmo plots when real-space structures are generated with more than one SLD. Up to 5 different SLDs are colored (this is a voxelgram limit on Gizmo)

Simulation scripting was tweaked so that the examples can be configured and run from the menu once it is enabled.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Analysis/Alpha/Tinker/FFT_VoxelDisplay.ipf

    r923 r924  
    5050 
    5151        Wave mat = root:mat 
    52         ParseMatrix3D_rho(mat) 
    5352         
    54         Wave rho3D = root:rho3D 
    55         NVAR solventSLD = root:FFT_SolventSLD 
    56  
    57         Variable np,val,ii,ind 
    58         string str 
    59  
    60 // how many different SLDs are there? 
    61         //loop through the rho wave, disregarding the solvent 
    62         Duplicate/O rho3D tmpSLD 
    63         Make/O/D/N=0 SLD_id 
    64         SLD_id = 0 
    65         np = 0 
    66  
    67         if(numpnts(rho3D)==0) 
    68                 return(0)               //nothing in matrix, get out 
     53        String listStr,str 
     54        listStr = ListOfValues(mat)             //returns a ";" delimited list of the different SLD values 
     55        //remove the solvent 
     56        NVAR val = root:FFT_SolventSLD 
     57        listStr = RemoveFromList(num2istr(val), listStr ,";") 
     58         
     59        print listStr 
     60         
     61        Variable numDiffSLD = ItemsInList(listStr ,";") 
     62        if(numdiffSLD > 5) 
     63                numDiffSLD = 5 
     64                DoAlert 0,"Only 5 different colors can be displayed. Some SLDs will not be displayed." 
    6965        endif 
    7066 
    71         do 
    72                 val = WaveMin(tmpSLD) 
    73                 if(val != solventSLD && val != 1e10) 
    74                         np += 1 
    75                         InsertPoints numpnts(SLD_id),1,SLD_id 
    76                         SLD_id[np-1] = val 
    77                 endif 
    78                 tmpSLD = (tmpSLD == val) ? 1e10 : tmpSLD                // set the values to 1e10 
    79         while(val != 1e10) 
    80         KillWaves/Z tmpSLD       
    81  
    82         Variable numDiffSLD = numpnts(SLD_id) 
    83         if(numdiffSLD > 5) 
    84                 DoAlert 0,"Only 5 different colors can be displayed. Some SLDs will not be displayed." 
    85         endif 
    86 //      print SLD_id 
    87  
     67        Variable ii,ind 
    8868//// now loop through and colorize the different parts 
    8969        Make/O/D/N=5 rr,gg,bb,aa 
     
    9171        gg = {0.244434,0,0.6,0.799954,0} 
    9272        bb = {1,0,0,0,0} 
    93         aa = 0.2 
     73        aa = 0.15                               //alpha = transparency 
    9474         
    95         for(ii=0;ii<5;ii+=1) 
     75        for(ii=0;ii<numDiffSLD;ii+=1) 
    9676                ind = ii 
    9777//      for(ii=0;ii<numDiffSLD;ii+=1) 
     
    9979                str = "ModifyGizmo/N=Gizmo_VoxelMat ModifyObject=voxelgram0 property={ valueRGBA," 
    10080                str += num2istr(ind)+"," 
    101                 str += num2istr(SLD_id[ind])+"," 
     81                str += StringFromList(ind, listStr ,";")   +"," 
    10282                str += num2str(rr[ind])+"," 
    10383                str += num2str(gg[ind])+"," 
     
    10686                         
    10787//              ModifyGizmo/N=Gizmo_VoxelMat ModifyObject=voxelgram0 property={ valueRGBA,ii,SLD_id[ii],rr[ii],gg[ii],bb[ii],aa[ii]} 
    108 //              print str 
     88                print str 
    10989                execute str 
    11090        endfor 
Note: See TracChangeset for help on using the changeset viewer.