Difference between revisions of "Slicer3:LUTs and Ontologies:Renumber Script"

From Slicer Wiki
Jump to: navigation, search
(Created page with 'Edit as needed to renumber wiki tables of slicer colors: <pre> set fpin [open "~/tmp/colors.wiki"] set fpout [open "~/tmp/colors2.wiki" "w"] set index 0 while { ![eof $fpin] } …')
 
 
Line 1: Line 1:
Edit as needed to renumber wiki tables of slicer colors:
+
Edit as needed to renumber [[Slicer3:2010_GenericAnatomyColors|wiki tables of slicer colors]]:
  
 
<pre>
 
<pre>

Latest revision as of 14:28, 10 June 2010

Home < Slicer3:LUTs and Ontologies:Renumber Script

Edit as needed to renumber wiki tables of slicer colors:

set fpin [open "~/tmp/colors.wiki"]
set fpout [open "~/tmp/colors2.wiki" "w"]

set index 0
while { ![eof $fpin] } {
  set line [gets $fpin]
  if { [scan $line "|%d" oldindex] != 1 } {
    puts $fpout $line
  } else {
    puts $fpout "|$index"
    incr index
  }
}

close $fpin
close $fpout