Flat Mapping

  1. Color the 3D object files by loading the object file and the latest minc file it was extracted from in Display. Brighten the minc by moving the threshold bar to a level you used while drawing sulci, and save files as pREVNUcase#_clrd.obj (the D key under the File menu) and move into a new directory named CORT.
    Display case#_nu_ss_7p_Atlas.mnc case#_nu_ss_7p_Atlas_#.obj
    mkdir CORT
     
  2. Before running the script named (flatten_script.csh), make sure you have copied the latest Shortened RSP3 (SHORTRSP3*) files from the RSPS directory into the CORT directory. If you only have the RSP3s and not the shortened version, you will need to run the following script to shorten the RSP3s:
    #!/bin/csh
    foreach x ( RSP3*.ucf )
    head -n 11 $x > SHORT$x
    echo “1.000000” >> SHORT$x
    head -n 118 $x > tmp
    tail -n 106 tmp > tmp2
    cat tmp2 >> SHORT$x
    tail -n 1 $x > tmp3
    cat tmp3 >> SHORT$x
    end
     
  3. Run flatten_script.csh within the directory CORT.
    csh flatten_script.csh 
  4. Open seg to view the flat maps and lines.
    seg -line 3 flat.uvl FLAT_*L*.ucf
    seg -line 3 flat.uvl FLAT_*R*.ucf

It is only necessary to load the first level of the ucfs. Note, 128 to 174 is a good normalization in seg for the color RGB images ordL.uif and ordR.uif.

Average Target Sulci

  1. Need to copy the Flatten Shorten RSP3s (SHORT_FLATRSP3*) into a new directory named AVG_FLAT
    mkdir AVG_FLAT
    cp SHORT_FLATRSP3* ./AVG_FLAT
     
  2. Run the flat_map_average_script in this directory to output out your 3d_flattened average sulci (3D_flatVAR_*)

Warping

  1. Open the warp_script text and edit the command lines appropriate to your study. They are directly under the caution line “##NOTE!!”
    nedit warp_script
  2. Run warp_script and then make sure the warping process didn’t produce any “holes” on the texture maps. These holes are black pixels that may result when 1) two sulcal lines intersect each other and produce a no-warp zone resulting in a black pixel or 2)when a sulcal line is too close to outside image paramters and actually drags a black pixel into the texture map.
  3. Open seg to view the warped-flat maps and warped lines.seg -line 3 precise_flat.uvl *tL.ucf (these are the average target ucfs)
    seg -line 3 precise_flat.uvl *tR.ucf

    It is a good idea to open the warped texture flat maps with the average-target sulci to see how well the warping actually was.

  4. If you notice black spots or holes, rewarp but by running the following no_holes_warp_script, which will rewarp by extracting the black hole out of the image. So it may take much longer to complete than the previous warps you ran.
  5. READOUT THE WARPED RGB files TO A WARPED 3D CORTEX:
    Make sure to change the cases and directory structure within the RGB_to_cortex_script according to study.
  6. Load in your new pair of cortex files – each one is a hemisphere: (vertical)
    prEw_hem_L.dx
    prEw_hem_R.dx
    (horizontal)
    prHEw_hem_L.dx
    prHEw_hem_R.dx

Making an Average Texture

  1. Check to see if all your needed uif’s are there in there resptive location: }
    ls */CORT*/WARP/pr*Ew*_Cord*L*uif
    ls */CORT*/WARP/pr*Ew*_Cord*R*uif
  2. mkdir AVG_TEXTURE 
  3. Now you will need to copy over these files but rename them to have different names so they will not copy over each other once you bring them over.cp 25/CORT/WARP/prEw_CordL.uif AVG_TEXTURE/1.uif
    cp 27/CORT/WARP/prEw_CordL.uif AVG_TEXTURE/2.uif
    cp 64/CORT/WARP/prEw_CordL.uif AVG_TEXTURE/3.uif
    cp 65/CORT/WARP/prEw_CordL.uif AVG_TEXTURE/4.uif
    cp 68/CORT/WARP/prEw_CordL.uif AVG_TEXTURE/5.uif
    cp 69/CORT/WARP/prEw_CordL.uif AVG_TEXTURE/6.uif
    cd AVG_TEXTURE

    foreach x ( *.uif )
    uiftoppm $x | pnmtotiff > $x:r.tiff
    end

    convert -average `ls *.tiff` av.tiff
    xv av.tiff

**Now do the same for the Right hemisphere.